Making an Incremental Backup

Backup all the InnoDB data and log files - located in /var/lib/mysql/ - once, then make two daily incremental backups in /data/backups/mysql/ (destination). Finally, prepare the backup files to be ready to restore or use.

Create one full backup

Making an incremental backup requires a full backup as a base:

xtrabackup --backup --target-dir=/data/backups/mysql/

It is important that you do not run the --prepare command yet.

Create two incremental backups

Suppose the full backup is on Monday, and you will create an incremental one on Tuesday:

xtrabackup --backup --target-dir=/data/backups/inc/tue/ \
      --incremental-basedir=/data/backups/mysql/

and the same policy is applied on Wednesday:

xtrabackup --backup --target-dir=/data/backups/inc/wed/ \
       --incremental-basedir=/data/backups/inc/tue/

Prepare the base backup

Prepare the base backup (Monday’s backup):

xtrabackup --prepare --apply-log-only --target-dir=/data/backups/mysql/

Roll forward the base data to the first increment

Roll Monday’s data forward to the state on Tuesday:

xtrabackup --prepare --apply-log-only --target-dir=/data/backups/mysql/ \
   --incremental-dir=/data/backups/inc/tue/

Roll forward again to the second increment

Roll forward again to the state on Wednesday:

xtrabackup --prepare --apply-log-only --target-dir=/data/backups/mysql/ \
   --incremental-dir=/data/backups/inc/wed/

Prepare the whole backup to be ready to use

Create the new logs by preparing it:

xtrabackup --prepare --target-dir=/data/backups/mysql/

Notes

  • You might want to set the --use-memory to speed up the process if you are on a dedicated server that has enough free memory. More details here.
  • A more detailed explanation is here.
Percona XtraBackup
Call Us
+1-888-316-9775 (USA - Sales)
+1-208-473-2904 (USA - Sales)
+44-208-133-0309 (UK - Sales)
0-800-051-8984 (UK - Sales)
0-800-181-0665 (GER - Sales)
+1-877-862-4316 (Emergency)
+1-855-55TRAIN (Training)
+1-925-271-5054 (Training)

Table Of Contents

Previous topic

Making a Full Backup

Next topic

Restoring the Backup

This Page



© Copyright 2009-2014, Percona LLC and/or its affiliates.
Except where otherwise noted, this documentation is licensed under the following license:
CC Attribution-ShareAlike 2.0 Generic
Created using Sphinx 1.2.2.
This documentation is developed in Launchpad as part of the Percona XtraBackup source code.
If you spotted innacuracies, errors, don't understood it or you think something is missing or should be improved, please file a bug.
]]>