Can i remove the full backup after first incremental? Is docker mysql supported?


I have limited space on DB server so I’m wondering if after I do the first incremental backup I can remove the full backup (of course after I copy it to another storage) to make place and then use the first incremental to do the second incremental backup etc. I did try and It didn’t give me any error so that means it’s possible?

Also I’m using mysql in docker so DB is in /home/docker/mysql/data/, is xtrabackup able to backup such DB or do I have to do docker exec container command… ?

This is how I do the backup:

percona-xtrabackup-2.4.29-Linux-x86_64.glibc2.17/bin/xtrabackup --user root --password=“password” --port=port --socket=/var/run/mysqld/mysqld.sock --host=ip --backup --target-dir=/root/backups/base --datadir /home/docker/mysql/data/

then the incremental:

percona-xtrabackup-2.4.29-Linux-x86_64.glibc2.17/bin/xtrabackup --user root --password=“password” --port=port --socket=/var/run/mysqld/mysqld.sock --host=ip --backup --target-dir=/root/backups/inc1 --incremental-basedir=/root/backups/base

thanks for your help!

Ps : I know I’m using old version but I have no other choice at this point. By the way I changed the last MyIsam tables to innoDB as I was fearing that this version of xtrabackup was skipping old engines.

1 Like

Hi keyrus,

When taking incremental backups, the “lsn” (log sequence number) is checked from the previous backup but the files are NOT compared vs the older backup.

You can get the lsn from xtrabackup_checkpoints file and you can consider using --incremental-lsn flag . More on this here: Incremental Backup - Percona XtraBackup

Last, remember that you need the last full backup (and any other intermediate incremental backup you have taken) in order to restore an incremental backup


1 Like

Thank you!

Which one is the lsn:

backup_type = full-backuped
from_lsn = 0
to_lsn = 22970977358568
last_lsn = 22970977358643
compact = 0
recover_binlog_info = 0
flushed_lsn = 22970974804162

to_lsn, last_lsn or flushed_lsn?