Page 1 of 1

MySQL & OpenKM Backup Info

PostPosted:Wed May 20, 2015 7:46 pm
by gwaitsi
I have OpenKM 6.3 working on OpenMediaVault NAS server with MySQL as the db engine.

The mysqldata directory has ibdata1 file of 622Mb.
I use the following Backup commands for MySQL
Code: Select all
# Perform the database dump and compression
echo "Dumping MySQL databases..." >> "$LOGFILE"
mysqldump --user=$user --password=$password --single-transaction --events --all-databases > $backup_path/$dbname-$date.sql

echo "Compressing database backup..." >> "$LOGFILE"
bzip2 $backup_path/$dbname-$date.sql
chmod 600 $backup_path/$dbname-$date.sql.bz2
the file size after the above commands is only 60Mb, can this be right?

I also backup the OpenKM repository with the following commands.
Code: Select all
# Synchronise directories ...
echo "Please wait, syncing </media/a7e96974-7965-4103-9743-281802f3d956//openkm> to </media/854fe912-9f08-423d-9bc8-26a404cae6d0/openkm> ...\n"
rsync --verbose --log-file="/var/log/rsync.log" --recursive --times --archive --delete --perms --acls --xattrs "/media/a7e96974-7965-4103-9743-281802f3d956//openkm/" "/media/854fe912-9f08-423d-9bc8-26a404cae6d0/openkm" & wait $!
Are the two things above sufficient to ensure a fullbackup on a daily basis?
The OpenKM system install should be covered by the weekly backup i do.

thanks for the advice

Re: MySQL & OpenKM Backup Info

PostPosted:Fri May 22, 2015 1:47 pm
by jllort
Yes rsync is enought, but I suggest something like rdiff-backup ( incremental backup ). With rsync you get the increment, but I think you can not restore backup two days or three old, with rdiff-backup you can do it.

About database seems right, anyway see this backup script:
http://wiki.openkm.com/index.php/Backup ... -_MySQL.29
Code: Select all
mysqldump -h localhost -u root -pXXXXX okmdb > mysql_okmdb.sql
I don't know the advantage of using --single-transaction --events, but seems right