Decompress and prepare a backup¶
Before you can prepare the backup you need to decompress all the files. Run the following commands as root or use the sudo command.
Decompress a backup¶
-
To decompress backups made using
LZ4orZSTDcompression algorithm, install the corresponding package.Install on APT systemssudo apt install lz4sudo apt install zstdInstall on YUM systemssudo yum install lz4sudo yum install zstd -
Use the
--decompressoption to decompress the backup.xtrabackup --decompress --target-dir=/data/compressed/Note
--parallelcan be used with--decompressoption to decompress multiple files simultaneously.Percona XtraBackup does not automatically delete compressed files. To clean up the backup directory, use the
--remove-originaloption. If you do not remove the compressed files, these files will not be copied or moved to the datadir when using the--copy-backor--move-backoptions.
Prepare the backup¶
When the files are decompressed you can prepare the backup with the --prepare option.
xtrabackup --prepare --target-dir=/data/compressed/
Confirmation message
InnoDB: Starting shutdown...
InnoDB: Shutdown completed; log sequence number 9293846
170223 13:39:31 completed OK!
Now the files in /data/compressed/ are ready to be used by the server.