MySQL Backup - Restoring from a Zmanda backup
How To Restore A MySQL Database from a Zmanda Backup
- Backups are written round robin daily by each of the xxxxctrl01-04mqp backup servers to autofs mapped volumes u05md1,u05md2,u05fc1,u05fd1. Using the mysql backup schedule determine which mapped volume the latest backup will reside on, or do a search through the successful zmanda backups emails to get the latest.
- SSH onto one of the 4 mysql backup control servers as root user.
- cd into the backup location to verify the backup file is there. As an example "cd /u05md1/mysql/xxxmyq7r_3317_B1/20171015060001/" "ls" then verify that there is a "backup-data" and "index" file within the folder. In this example the "B1" means schedule B and backup server 1. The "20171015060001" refers to the date/time the backup was taken, "backup-data" is the actual backup file zipped up. "index" contains information about the backup.
- Perform the restore by
using the "mysql-zrm-restore" command. This can be run from any on the
control servers and will be in the format as follows in the below
example where host should be replaced with the target host, databases
should be the databases being restored (can be multiple separated by a
space), port is the port of the target and password is the password of
the target. Source is the location of the backup we are restoring from:
mysql-zrm-restore --verbose --databases "eventsplanning" --host xxxxxx.xxxx.xxx.xxxxx.xx --port 3307 --user root --password h0rnet40 --source /u05md1/mysql/xxxmyq7r_3317_B1/20171015060001/ - After carefully checking your mysql-zrm-restore command hit return, and the restore procedure will start by verifying your parameters, it will then unzip the backup-data file, then restore the database. Any existing database / tables will be overwritten. Zmanda is a logical restore and behind the scenes is doing a standard mysqldump restore. It is possible to manually unzip the backup-data file and restore using mysqldump using source command but we should always use zmanda unless there is a good reason not too (e.g. a partial restore of a table).
- On completion there should be a successful message.
Comments