Search code examples
percona

Can not apply second incremental backup file using xtrabackup


I am trying to follow the steps mentioned on this page:

https://www.percona.com/doc/percona-xtrabackup/LATEST/backup_scenarios/incremental_backup.html

I have successfully managed to apply logs from inc1 folder. (i.e. /data3/backups/inc1)

bin/xtrabackup --prepare --apply-log-only --target-dir=/data3/backups/ --incremental-dir=/data3/backups/inc1

But the next incremental backup can not be applied because the previous command that applied inc1 backup, removed the checkpoints file from inc2 folder (which is very strange)

# bin/xtrabackup --prepare  --target-dir=/data3/backups/ --incremental-dir=/data3/backups/inc2
xtrabackup: Error: cannot open /data3/backups/inc2//xtrabackup_checkpoints
xtrabackup: error: failed to read metadata from /data3/backups/inc2//xtrabackup_checkpoints

How do I apply the second incremental file?


Solution

  • The issue is that incremental directory can not be within the base directory. So this config is wrong:

    --target-dir=/data3/backups/ --incremental-dir=/data3/backups/inc2
    

    It should be ...

    --target-dir=/data3/backups/full --incremental-dir=/data3/backups/inc2
    

    In other words full and incremental directories should be visible like this...

    # ls /data3/backups/
    full  inc1  inc2
    

    If inc1 and inc2 are within "full" sub-folder then you will have problems!