Incremental backups on compressed full backup

Hello everyone! I’m sorry if this question duplicates similar questions in some way, but I’m looking for simple and straight forward answer that can be used by other people later.

So, I’m making a full backup with -compress option. Then I will use this base backup for incremental backups.

Do I need to uncompress full backup before making incrementals based on it?

If no, do I need to use something like -incremental-lsn option to pass the LSN from the previous full backup or I can make an incremental backup as I would if the full backup wasn’t compressed
(xtrabackup --backup --target-dir=/data/backups/inc1 --incremental-basedir=/data/backups/base)?

And if xtrabackup handle this internally and I don’t need extra options or different approach for making incrementals for compressed backup, how do I properly prepare full backup when I will need to restore it? Is there any changes in preparing the incremental backups and the full one?


No, you do not.

Yes, as I believe the xtrabackup_checkpoints file will be compressed in the full, and I’m unsure if PXB will read the compressed file when you run the incremental. This would be super easy to test. Just run the incremental command as you showed, and if PXB cannot read the compressed checkpoints file, it will simply exit. Then you know that file needs to be decompressed first or the lsn supplied in another way.

1 Like

Thank you for reply, I will perform tests and write you back.

Hello, xtrabackup_checkpoints file wasn’t compressed in the base backup so the basic command worked fine.

Now, when I will need to restore backup I must uncompress base backup, then prepare it, then prepare it with incrementals and restore.

One more question: as I understand, the incremental backup made without -compress option based on compressed base backup is not compressed.

Note: used XtraBackup 2.4


You must explicitly say you want the backup compressed. Just decompress it before you prepare it.

1 Like