Posts

Akeeba Backup restore problem restoring large backup file [Solution]

I had a rather large Akeeba Backup file (about 25 GB) which I tried to restore using Akeeba kickstart from the web browser. It took a long time unpacking the archive but never reached the point where database is being restored.

The Akeeba kickstart (version 5.0 or later) can be run from command line (shell) and this works better with really large backup files. Simply go to the directory where you have your JPA-file which should be the same directory where it should be restored and enter:

php kickstart.php archive.jpa

But of course replace archive.jpa whith your archive name. There are more command line options available.

After unpacking the archive, go with your browser to https://yourdomain.com/installation and complete the restore.

mysqldump to multiple files

It is a good idea to run mysqldump by cron to regurlarly make backups of your MySQL databases. An easy way to do this is by adding the –all-databases parameter.  This way you will have a backup of all your databases – in one file though. If the amount of data and the number of databases is small this might be ok.

After the first session of restoring just one database or one table from your one-file-backup you realize that it would be nice to have the dumps split up in some convenient way. Like dumping each database to one file, one for each database.

This little shell script does the trick for you. It is really simple and has no error handling what so ever. It is released under GNU GPLv2 license. If you modifiy it or add features (like error handling or so), please do send me a copy or post it as a comment here.


#!/bin/sh
# mysqldump-multi.sh
# Copyright HelTech Communication, Stefan Helander 2010
# stefan@heltech.se, http://www.heltech.se
#
# Licensed under GNU GPLv2
#
# Dumps all MySQL databases. Each database stored in a single file.
#
# settings

DUMPDIR=/root/mysql-backup/backups
MYSQL_HOST=localhost
MYSQL_USER=root
MYSQL_PASS=YOUR-PASSWORD-HERE
MYSQL=/usr/bin/mysql
MYSQLDUMP=/usr/bin/mysqldump

# dump each db

for DB in `echo 'show databases' | $MYSQL -h$MYSQL_HOST -u$MYSQL_USER -p$MYSQL_PASS --batch -N`
do
$MYSQLDUMP -h$MYSQL_HOST -u$MYSQL_USER -p$MYSQL_PASS --quote-names --create-options --force $DB > $DUMPDIR/$DB.sql
done