4.1.1.3 Restore an Existing Backup

Restores the data files from a backup to their original locations within the database server. The MySQL instance must be shut down first before a restore operation. The options datadir, innodb_log_files_in_group, and innodb_log_file_size 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. For usage and examples, see Chapter 5, Recovering or Restoring a Database.

mysqlbackup [STD-OPTIONS]
            [SERVER-REPOSITORY-OPTIONS]
            [--backup-dir=PATH]
            [MESSAGE-LOGGING-OPTIONS]
            [PROGRESS-REPORT-OPTIONS]
            copy-back

mysqlbackup [STD-OPTIONS]
            [--backup-image=IMAGE]
            [--backup-dir=PATH]
            [MESSAGE-LOGGING-OPTIONS]
            [PROGRESS-REPORT-OPTIONS]
            copy-back-and-apply-log 
Warning

When restoring a server for replication purpose, if the backed-up server has used the innodb_undo_directory option to put the undo logs outside of the data directory, when using the file server-my.cnf or server-all.cnf for the --defaults-file option with copy-back or copy-back-and-apply-log, care should be taken to configure correctly the innodb_undo_directory option in the file. Otherwise, the data or log files on the original server might be overwritten by accident.