Documentation Home
MySQL Enterprise Backup 4.0 User's Guide
Related Documentation Download this Manual
PDF (US Ltr) - 1.1Mb
PDF (A4) - 1.2Mb
EPUB - 231.9Kb
HTML Download (TGZ) - 179.5Kb
HTML Download (Zip) - 210.8Kb

5.1 Performing a Restore Operation

The mysqlbackup commands to perform a restore operation are copy-back-and-apply-log and copy-back (for directory backup only; see Section 5.1.6, “Advanced: Preparing and Restoring a Directory Backup”). Normally, the restoration process requires the database server to be already shut down (or, at least not operating on the directory you are restoring the data to), except for restorations of backups created with the --use-tts option; see explanations below. The process copies the data files, logs, and other backed-up files from the backup directory back to their original locations, and performs any required post-processing on them. For any restore operation, the options datadir, innodb_log_files_in_group, innodb_log_file_size, and innodb_data_file_path must be specified either in the target server's configuration file, in the file specified by the --defaults-file option, or as command-line options.

Example 5.1 Restoring a Database

mysqlbackup --defaults-file=<backupDir>/backup-my.cnf -uroot --backup-image=<image_name> \
  --backup-dir=<backupTmpDir> --datadir=<restoreDir> copy-back-and-apply-log

The copy-back-and-apply-log command achieves two things:

  • Extracts the backup from the image file and copies it to the data directory on the server to be restored.

  • Performs an apply log operation to the restored data to bring them up-to-date.

The restored data includes the backup_history table, where MySQL Enterprise Backup records details of each backup. The table allows you to perform future incremental backups using the --incremental-base=history:last_backup option.

  • When performing a full restore (for example, when the backup data is used to set up a new MySQL server or used to replace all data of an existing MySQL server), make sure the target data directories are all clean, containing no old or unwanted data files (this might require manual removal of files at the locations specified by both the --datadir and --innodb_data_file_path options); otherwise, add the --force option to the restore command to overwrite the old data. The same cleanup is not required for restoring backups created with the--use-tts option (in which case other requirements described in Section 5.1.4, “Restoring Backups Created with the --use-tts Option” apply though), and usually not necessary for restoring a partial backup.

  • Due to a known issue (Bug# 20485910), restoring a partial image backup created with MySQL Enterprise Backup 3.11 or earlier requires using the --force option.

The following subsections describe a number of different scenarios for restoring a backup.

User Comments
Sign Up Login You must be logged in to post a comment.