Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InnoBackupex Incremental support #176

Open
Rockstar04 opened this issue Aug 22, 2017 · 3 comments
Open

InnoBackupex Incremental support #176

Rockstar04 opened this issue Aug 22, 2017 · 3 comments

Comments

@Rockstar04
Copy link

Would it be possible, or within Hollands current scope to support InnoBackupex incremental backups?

@ryanpwzhu
Copy link

Want to ask about this too: are there plans to add support for incremental backups with XtraBackup?

@soulen3
Copy link
Contributor

soulen3 commented May 29, 2019

I'd like to add this, but don't have a timeline for it. There will be some complexity in making sure holland doesn't purge a full backup (making an incremental backup useless), and we'll need to add configuration options to define how these backups should be handle. If the framework is setup correctly, we should be able support several different incremental options.

@crishoj
Copy link

crishoj commented Mar 22, 2022

I've been tinkering with configuration for incremental backups using the mariabackup plugin.

Define a full backup set with these extra options:

[mariabackup]
additional-options = --extra-lsndir=/tmp/lsn-full

[holland:backup]
create-symlinks = yes
after-backup-command = cp /tmp/lsn-full/xtrabackup_info /tmp/lsn-full/xtrabackup_checkpoints ${backupdir}/

After completion of the full backup set, a non-compressed copy of the extrabackup_* LSN files required for incremental backups will be available in the backup directory:

--- Starting backup run ---
Creating backup path /var/spool/holland/full/20220322_231430
Executing: /bin/mariabackup --defaults-file=/var/spool/holland/full/20220322_231430/my.cnf --backup --stream=xbstream --tmpdir=/var/spool/holland/full/20220322_231430 --slave-info --extra-lsndir=/tmp/lsn-full --target-dir=/var/spool/holland/full/20220322_231430
  > /var/spool/holland/full/20220322_231430/backup.mb.gz 2 > /var/spool/holland/full/20220322_231430/mariabackup.log
Final on-disk backup size 87.92GB
Backup completed in 10 minutes, 59.99 seconds
 [after-backup-command]> cp /tmp/lsn-full/xtrabackup_info /var/spool/holland/full/20220322_231430/

Now define an incremental to perform an incremental backup based on the latest full backup:

[holland:backup]
create-symlinks = yes
after-backup-command = cp /tmp/lsn-incremental/xtrabackup_info /tmp/lsn-incremental/xtrabackup_checkpoints ${backupdir}/

[mariabackup]
additional-options = --incremental-basedir=/var/spool/holland/full/newest,--extra-lsndir=/tmp/lsn-incremental

This backup should be run once, after the full backup:

--- Starting backup run ---
Creating backup path /var/spool/holland/incremental/20220322_234344
Executing: /bin/mariabackup --defaults-file=/var/spool/holland/incremental/20220322_234344/my.cnf --backup --stream=xbstream --tmpdir=/var/spool/holland/incremental/20220322_234344 --slave-info --incremental-basedir=/var/spool/holland/full/newest --extra-lsndir=/tmp/lsn-incremental --target-dir=/var/spool/holland/incremental/20220322_234344
  > /var/spool/holland/incremental/20220322_234344/backup.mb.gz 2 > /var/spool/holland/incremental/20220322_234344/mariabackup.log
Final on-disk backup size 3.46GB
Backup completed in 2 minutes, 9.86 seconds
 [after-backup-command]> cp /tmp/lsn-incremental/xtrabackup_info /tmp/lsn-incremental/xtrabackup_checkpoints /var/spool/holland/incremental/20220322_234344/

Subsequent incremental backups should be based on the latest incremental backup.
I figure this requires a third backup set, subsequent, with a different --incremental-basedir option:

[mariabackup]
additional-options = --incremental-basedir=/var/spool/holland/incremental/newest,--extra-lsndir=/tmp/lsn-incremental

To enable repeated incremental backups, create a symlink in the spool directory for incremental as subsequent.

Scheduling the commands:

  • holland bk full.conf (infrequently)
  • holland bk incremental (once after the full backup)
  • holland bk subsequent (frequently, after incremental has run)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants