Learn about Centmin Mod LEMP Stack today
Become a Member

Sysadmin MariaDB backup tool question

Discussion in 'System Administration' started by pamamolf, Dec 16, 2019.

  1. pamamolf

    pamamolf Premium Member Premium Member

    3,884
    381
    83
    May 31, 2014
    Ratings:
    +741
    Local Time:
    9:03 AM
    Nginx-1.17.x
    MariaDB 10.3.x
    Hello :)

    I did some tests with MariaDB backup tool but i can't get the idea/reason of the way that works.

    For example i get a full backup and then 5 incremental backups.

    Then on restore i use the prepare and then the cp command and it always works great.

    But if i select for example the incremental backup 5 and then i want anything less than that like 2 it will not work as the main file is already merged with 5...

    When an incremental backup is merged with the main backup then the main backup it can go only forward for example if i merge 5 then i can go to 6 or 7 but not on any lower incremental backup like 2.....

    What am i missing here?

    Any ideas?

    Also the incremental backups are moved to the main backup and not copied :(

    Thanks
     
  2. eva2000

    eva2000 Administrator Staff Member

    45,656
    10,358
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,076
    Local Time:
    5:03 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Not sure I understand what you're doing ? Incremental backups are just that = incremental so each incremental backup relies on the integrity of the previous incremental backup and the full initial backup to work in a restore scenario.

    You're meant to prepare all incrementals in order of their creation so prepare increment 1, 2, 3, 4 and then 5
    You can't skip incremental backups like pick incremental backup 5 only and not incremental backups 2, 3 and 4. If you want to restore at moment in time backups, you need to use MySQL binary logging which can eat alot of disk space if you have large databases you're looking at 100s of in binary logs required.

    see above links I posted on restoring process like Percona XtraDB Backup, restore involves both a prepare step and them copy back restore step. Prepare is only part of the restore process. You'd definitely want to read the official manuals more carefully ;)

    But if you still want a copy of the incrementals if they don't survive after the prepare stage, then make a separate copy of them somewhere. The incrementals after a prepare stage are of no use to any other database server than the one you're working on as that is nature of incrementals, they are only valid against the initial full backup they were created from.
     
  3. pamamolf

    pamamolf Premium Member Premium Member

    3,884
    381
    83
    May 31, 2014
    Ratings:
    +741
    Local Time:
    9:03 AM
    Nginx-1.17.x
    MariaDB 10.3.x
    What i mean is that the incremental backup is usefull for only one restoration. After that is dead and if you select a restore point then you can't change your mind....

    It seems that's the way that it works....