There are two types of operations to bring your backup data up-to-date:
After a backup job was first completed, the backup data might
not be in a consistent state, because data could have been
inserted, updated, or deleted while the backup was running.
This initial backup file is known as the
raw backup. During a
backup, mysqlbackup also copies the
accumulated InnoDB log to a file called
ibbackup_logfile
. In an apply-log
operation, the ibbackup_logfile
file is
used to “roll forward” the raw data files, so
that every page in the data files corresponds to the same log
sequence number of the InnoDB log. This is similar to the
operation that takes place during a
crash recovery.
For single-file backups, the apply-log operation is usually
performed as part of the
copy-back-and-apply-log
command.
For directory backups, the
copy-back-and-apply-log
command
can also be used, but you also have the two alternatives of
Performing the apply-log operation together with the back up using the
backup-and-apply-log
command (not applicable for incremental or compressed directory backups)Performing the apply-log operation separately with the
apply-log
command on the raw backup, before running thecopy-back
command.
mysqlbackup [STD-OPTIONS]
[--limit-memory=MB] [--uncompress] [--backup-dir=PATH]
[MESSAGE-LOGGING-OPTIONS]
[PROGRESS-REPORT-OPTIONS]
[ENCRYPTED-INNODB-OPTIONS]
apply-log
Advanced: Brings the InnoDB tables in the directory backup up-to-date, including any changes made to the data while the backup was running.
Example 19.1 Apply Log to Full Backup
mysqlbackup --backup-dir=/path/to/backup apply-log
It reads the backup-my.cnf
file inside
backup-dir
to understand the
backup. The my.cnf
defaults files have
no effect other than supplying the
limit-memory=
value, which limits usage of memory while doing the
MB
apply-log
operation.
Advanced: Use the
apply-incremental-backup
to update
a backup directory with data in an incremental backup
directory:
mysqlbackup [STD-OPTIONS]
[--incremental-backup-dir=PATH] [--backup-dir=PATH]
[--limit-memory=MB] [--uncompress]
[MESSAGE-LOGGING-OPTIONS]
[PROGRESS-REPORT-OPTIONS]
[ENCRYPTED-INNODB-OPTIONS]
apply-incremental-backup
Advanced: Brings up-to-date a directory
backup specified with the
--backup-dir
option, using the
data from an incremental backup directory specified with the
--incremental-backup-dir
option.
See Section 5.1.3, “Restoring an Incremental Backup” for instructions on
restoring incremental backups.
For a single-file incremental backup, you typically use the
copy-back-and-apply-log
command
to apply the data in the incremental image backup to the full
backup that has already been restored to the data directory of
the target server.