5.2 Performing a Restore Operation

As explained in Section 1.5, “Overview of Restoring a Database”, the mysqlbackup option to perform a restore operation is copy-back. It requires the database server to be already shut down, then copies the data files, logs, and other backed-up files from the backup directory back to their original locations, and performs any required postprocessing on them.

Example 5.4 Shutting Down and Restoring a Database

mysqladmin --defaults-file=/usr/local/mysql/my.cnf --user=root --password shutdown
mysqlbackup --defaults-file=/usr/local/mysql/my.cnf \
  --backup-dir=/export/backups/full \
    copy-back

Note

The restored data includes the backup_history table, where MySQL Enterprise Backup records details of each backup. Restoring this table to its earlier state removes information about any subsequent backups that you did. This is the correct starting point for future incremental backups, particularly those using the --incremental-base option.

Important

Before restoring a partial backup, you might need to delete first from the backup the .frm files associated with InnoDB tables that were not backed up. See Section 4.1.9, “Partial Backup Options” and Section 3.3.4.1, “Backing Up Some or All InnoDB Tables” for details.