For an overview of incremental backups and usage examples for these options, see Section 4.3.3, “Making a Differential or Incremental Backup” and Section 5.1.3, “Restoring an Incremental Backup”.
To take an incremental backup, specify the
along with the
Depending on whether
used, other options are required or recommended. All InnoDB data
modified after the a certain LSN
(specified directly or indirectly by the options you use) is
copied into the incremental backup. For MySQL Enterprise Backup 8.0.20
and ealrier: to restore an incremental backup,
(the option is no longer required for MySQL Enterprise Backup 8.0.21 and later for
Type Enumeration Default Value
page-track: For MySQL Enterprise Backup 8.0.18 and later: mysqlbackup looks for changed pages in the InnoDB data files that have been modified since the last backup using the page tracking functionality on the server and then copies them. This is potentially the fastest way for mysqlbackup to create incremental backups. Even with this value set, the page tracking functionality is only used when certain requirements are satisfied; see Incremental Backup Using Page Tracking for details.
full-scan: mysqlbackup scans all InnoDB data files in the server's data directory to find pages that have been changed since the last backup and copies them.
optimistic: mysqlbackup only scans for changed pages in the InnoDB data files that have been modified since the last backup and then copies them. In general, optimistic incremental backups are faster than full-scan ones when not many tables in the database have been modified; however a few restrictions apply to this feature. See Full-scan versus Optimistic Incremental Backup for details.
page-track, for MySQL Enterprise Backup 8.0.18 and later. However, if the page tracking functionality cannot be utilized by mysqlbackup for some reasons (see Incremental Backup Using Page Tracking for details), mysqlbackup performs a full-scan backup instead if the
--incrementaloption is not set, or throws an error when
For MySQL Enterprise Backup 8.0.17 and earlier, full-scan backup is the default method for incremental backups, which is utilized if no value is specified for
During a backup, the
--incrementaloption also requires the use of either the
--incremental-baseoption or the
--start-lsnoption. Only InnoDB tables are backed up incrementally. By default, all non-InnoDB files are included into the incremental backup and in their fullness. To exclude non-InnoDB data in an incremental backup, use the
The value for the option has only meaning when the option is used an incremental backup.
For MySQL Enterprise Backup 8.0.20 and earlier: For a
apply-log, operation, specifies that the associated backup is incremental (the option is no longer required for MySQL Enterprise Backup 8.0.21 and later for restore operations).
Specifies that an incremental backup is to be created using only the redo log. This alternate type of incremental backup has different performance characteristics and operational limitations comparing to backups created with the
--incrementaloption; see Creating Incremental Backups Using Only the Redo Log for a discussion on their differences.
To use this option, you also need to specify the
--incremental-baseoption or the
--start-lsn. Just like with the
--incrementaloption, only InnoDB tables are backed up incrementally. By default, all non-InnoDB files are included into the incremental backup and in their fullness. To exclude non-InnoDB data in an incremental backup, use the
With this option, the mysqlbackup retrieves the information needed to perform incremental backups from the metadata inside the backup directory rather than from the
--start-lsnoption. It saves you from having to specify an ever-changing, unpredictable LSN value when doing a succession of incremental backups. Instead, you specify a way to locate the previous backup directory through the combination of
argumentin the option syntax. The alternatives are:
history:[last_backup | last_full_backup]
history:followed by one of the two possible values:
last_backup: This makes mysqlbackup query the
end_lsnvalue from the last successful non-TTS backup as recorded in the
backup_historytable of the server instance that is being backed up.
last_full_backup: (For MySQL Enterprise Backup 8.0.17 and later) This works similarly as the value
last_backup, except that it makes mysqlbackup look for the last full backup that was taken and use it as the base backup, thus creating a differential backup.
Advanced: You specify the prefix
dir:followed by a directory path argument, which points to the previous directory backup. With the first incremental backup, you specify the directory holding the full directory backup; with the second incremental backup, you specify the directory holding the first incremental directory backup, and so on.
In an incremental backup, specifies the highest LSN value included in a previous backup. You can get this value from the output of the previous backup operation, or from the
end_lsncolumn for the previous backup operation. Always used in combination with the
--incrementaloption; not needed when you use the
--incremental-baseoption; not recommended when you use the
--incremental-with-redo-log-onlymechanism for incremental backups.Note
No binary log files are copied into the incremental backup if the
--start-lsnoption is used. To include binary log files for the period covered by the incremental backup, instead of
--start-lsn, use the
--incremental-baseoption, which provides the necessary information for mysqlbackup to ensure that no gap exists between binary log data included in the previous backup and the current incremental backup.
Advanced: Specifies the location for data of an incremental directory backup. When creating or restoring an incremental directory backup, the option serves the same function as
--backup-dirdoes for backups and restores in general, and the option can in fact be used interchangeably with
--backup-dirfor directory backups. See the description for
Do not use this option with any operations for image backups, for which the option has no meaning.