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
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 4, Recovering or Restoring a Database.
mysqlbackup [STD-OPTIONS] [SERVER-REPOSITORY-OPTIONS] [
PATH] [MESSAGE-LOGGING-OPTIONS] [PROGRESS-REPORT-OPTIONS] [CLOUD-STORAGE-OPTIONS]
copy-backmysqlbackup [STD-OPTIONS] [SERVER-REPOSITORY-OPTIONS] [
PATH] [MESSAGE-LOGGING-OPTIONS] [PROGRESS-REPORT-OPTIONS] [ENCRYPTION-OPTIONS] [CLOUD-STORAGE-OPTIONS]
Some clean-up efforts on the target directory for restoration might be needed before preforming 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). See Section 4.2, “Performing a Restore Operation” for details.
There are some special requirements when restoring backups
created with the
option; see Restoring Backups Created with the --use-tts Option for details.
In a single step, restores a
backup specified by the
option or a backup from the directory specified by the
--backup-dir option to a
server's data directory and performs an
apply-log operation to the
restored data to bring them up-to-date. Comparing with a
multi-step approach (which typically consists of
performing the successive steps of
(for restoring compressed image) or
(for uncompressed image), and
backup), the option makes the restoration process
simpler and faster, and also saves the disk space
At the end of the
operation, the file
backup_variables.txt is being created
or updated in the data directory. This file contains
metadata about the restored contents and is being used by
successive single-step restores of incremental backups; it
should not be deleted or modified by users.
To restore a compressed directory or image, include the
--uncompress option in the
To restore an incremental backup using the option, make sure the following requirements are followed:
--incremental option in
the command line.
To restore incremental backups using
the full backup on which the incremental backups
were based on must first be restored, either by a
copy-back or a
operation. To use the incremental backups just to
update a full backup, use the
To restore a backup created with the
--use-tts option, see the
special requirements described in
Restoring Backups Created with the --use-tts Option.
restore a backup directory created with the option
operation will be performed on the backup directory.
That means the backup taken will be altered during the
process, and users might want to make an extra copy of
the backup directory before proceeding with the
restoration, in order to prevent the loss of backup data
in case something goes wrong.
Also note the following:
For image backups taken with MySQL Enterprise Backup
3.8.2 or earlier, per-table
.ibd files pointed to by
.isl files in a backup are
restored to the server's data directory rather than
the locations pointed to by the .isl files.
When restoring an image backup, temporary metadata
files are extracted to the folder specified by the
When restoring an image backup created with the
all tables in the backup are extracted temporarily
into the folder specified by the
--backup-dir option, in
operation will be performed and the data made
up-to-date before being restored to the server's
When restoring a server for
if the backed-up server has used the
option to put the undo logs outside of the data directory,
when using the file
server-all.cnf for the
--defaults-file option with
should be taken to configure correctly the
in the file. Otherwise, the data or log files on the
original server might be overwritten by accident.