Streaming and Compressing Backups

Streaming mode, supported by XtraBackup, sends backup to STDOUT in special tar format instead of copying files to the backup directory.

This allows to pipe the stream to other programs, providing great flexibility to the output of it. For example, compression is achieved by piping the output to a compression utility.

Warning

If both –stream and –incremental are passed to innobackupex, the incremental parameters are ignored and a full backup is created.

To use this feature, you must use the --stream, providing the format of the stream (only tar is supported at this moment) and where should the store the temporary files:

$ innobackupex --stream=tar /tmp

innobackupex starts xtrabackup in --log-stream mode in a child process, and redirects its log to a temporary file. It then uses tar4ibd to stream all of the data files to STDOUT, in a special tar format. See The tar4ibd Binary for details. After it finishes streaming all of the data files to STDOUT, it stops xtrabackup and streams the saved log file too.

To store the backup in one archive it directly

$ innobackupex --stream=tar /root/backup/ > /root/backup/out.tar

For sending it directly to another host by

$ innobackupex --stream=tar ./ | ssh user@destination \ "cat - > /data/backups/backup.tar"

Warning

To extract XtraBackup ‘s archive you must use tar with -i option:

$ tar -xizf backup.tar.gz

Choosing the compression tool that best suits you:

$ innobackupex --stream=tar ./ | gzip - > backup.tar.gz
$ innobackupex --stream=tar ./ | bzip2 - > backup.tar.bz2

Note that the streamed backup will need to be prepared before restoration. Streaming mode does not prepare the backup.

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)

Previous topic

Partial Backups

Next topic

Taking Backups in Replication Environments

This Page



© Copyright 2010-2012, Percona Ireland Ltd.
Except where otherwise noted, this documentation is licensed under the following license:
CC Attribution-ShareAlike 2.0 Generic
Created using Sphinx 1.1.3.
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.
]]>