Abiquo Backup
This document is a guide to backing up Abiquo. Every Abiquo installation is different so you must ensure that your backup configuration is appropriate for your installation. This guide gives a general explanation of which parts of Abiquo need to be backed up and how to do this manually and with Rsnapshot.
Create backups
Abiquo Server, Remote Services and V2V
Save Abiquo directory
$ cp -R /opt/abiquo /path/to/backup/
Abiquo Server
Save MySQL data:
$ mysqldump kinton --routines --triggers > /path/to/backup/mysql/kinton-dump.sql
$ mysqldump kinton_accounting --routines --triggers > /path/to/backup/mysql/kinton_accounting-dump.sql
Save Redis data
$ redis-cli
redis> SAVE
redis> exit
$ cp /var/lib/redis/dump.rdb /path/to/backup/redis
Abiquo Remote Services
Save DHCPD leases generated by Abiquo:
Save Redis data:
Save /etc/fstab if you have made changes to the configuration since you installed Abiquo.
Restore backups
Abiquo Server, Remote Services, and V2V
Restore Abiquo properties:
Abiquo Server
Restore MySQL data:
Restore Redis data:
Abiquo remote services
Restore /etc/fstab configuration:
Restore Redis data:
Restore DHCPD leases:
Restart Abiquo
Now you can restart the Abiquo Tomcat daemon:
Configure a remote backup server
Now we will describe how to configure a remote CentOS server to do the backups via rsnapshot. In this example we have an Abiquo Server (10.60.20.100) and an Abiquo Remote Services Server (10.60.20.101).
Prepare backup server
First of all, on the backup server, install rsnapshot (you may need to install RPMForge repositories first, you can follow the CentOS RPMForge guide) and then:
Create the directory where you want to store the backups:
Generate SSH keys
We need to set up SSH keys without passwords in order to do backups automatically. Generate a pair of public/private keys on the backup server, leaving the passphrase empty:
Copy the public key to the host or hosts where you want to do the backup:
Install rsync
After you have successfully completed the above steps, you can install rsync on the target hosts:
Configure rsnapshot
Elements in this file must be separated by tabs, and directories must end with a trailing slash '/'. Be careful of this if you do a copy & paste. You can split long lines by beginning a new line with a space or a tab character. All leading and trailing whitespace will be stripped off the new line, then it will be joined to the previous line with a tab character during configuration file parsing.
Edit /etc/rsnapshot.conf, and add the backup points that fit your needs. In our example:
As you can see in the configuration above, we use scripts in order to do MySQL and Redis dumps. The scripts are stored on the backup server. Put them under your /opt/backups/ directory, and modify the HOST variable to suit your needs:
backup_mysql.sh
Â
backup_redis.sh
Then make them executable:
Set up crontab
Automation is easily attainable using a simple crontab entry. Open /etc/crontab and add the following:
This setup runs a daily backup at 2:15am, a weekly backup on Sunday at 3:15am, and a monthly backup on the first of the month at 3:30am.