Backup and restore mysql (innodb)

From Zarafa wiki

Jump to: navigation, search

For example if you have just stored your attachments outside of the mysql database, you will want to backup and restore your Zarafa mysql database.

To do this, follow these steps.

  • Stop zarafa and smtp (postfix) services
  • Make a mysql backup (e.g. mysqldump --single-transaction -u <user> -p <password> <database> > backup.sql)
  • Stop mysql server and backup your ibdata and ib_logfiles from the /var/lib/mysql folder
  • Check your mysql backup to make sure that you have a proper backup
  • Start mysql server and drop the zarafa database
  • Stop mysql server and remove the ibdata1 and ib_logfiles (assuming you backed them up in the previous steps!)

Optional - Tune MySQL

  • Copy your my.cnf configuration file to a safe place
  • Follow MySQL_tuning

  • Start mysql server and create the zarafa database
  • Restore your backup (e.g. mysql -u <user> -p <password> <database> < backup.sql)
  • Wait till it finishes (can take very long with huge databases!)
  • Start zarafa and smtp (postfix) services
  • Check if everything is working!
Personal tools