Not the answer you need?
Register and ask your own question!

How can I do incremental backup to a remote server without full backup in local

tonysunxdtonysunxd EntrantCurrent User Role Beginner
Hi Gurus,

I would like to setup a backup center to store all the backup sets of 3 mysql databases. My policy is doing 1 full backup one week and incremental backup every other days in this week. All the backup sets will be compressed and encrypted. The backup sets will be sent to the backup center after finishing backup without leaving a copy at local.

I would like to choose xtrabackup to do this. But after doing the research, I found that the incremental backup is based on the full backup. Since the full backup already sent to the remote server, how can I resolve this issue? I appreciate if anyone can give a solution.

I would like to choose --stream=tar and using gzip to do compressing work.

Many thanks,

Tony

Comments

  • scott.nemesscott.nemes MySQL Sage Current User Role Patron
    Hi Tony;

    You may do this by using the --incremental-lsn option instead of --incremental-basedir option when performing the incremental backup. You will however still need to access the base backup somehow to find that LSN (or store it locally to start with).

    If you look at your base backup, in the file xtrabackup-checkpoints, you will see something like:
    backup_type = full-backuped from_lsn = 0 to_lsn = 1291135
    The "to_lsn" value is what you want to set your --incremental-lsn value to. Then when you run your second incremental, you'll have to get the same to_lsn value from the previous incremental, and so on.

    https://www.percona.com/doc/percona-xtrabackup/2.3/innobackupex/innobackupex_option_reference.html#cmdoption-innobackupex--incremental-lsn

    -Scott
  • tonysunxdtonysunxd Entrant Current User Role Beginner
    Hi Scott,

    Appreciate your kindly reply. It's really help.

    I understand this if I can get the LSN number, I do not need the base backup to do the next one.

    So I will try to leave this LSN info. to a local file after I finished each backup, reading this LSN info. before starting each incremental backup.

    Many thanks,

    Tony
  • tonysunxdtonysunxd Entrant Current User Role Beginner
    Found a solution: using
  • scott.nemesscott.nemes MySQL Sage Current User Role Patron
    Hi Tony;

    Nice find! That sounds like a good solution to your problem.

    -Scott
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.