MySQL/MariaDB data directory backupMySQL incremental backups per database (not global)Are ZRM (Zmanda...

Why is it that Bernie Sanders is always called a "socialist"?

"Starve to death" Vs. "Starve to the point of death"

Identical projects by students at two different colleges: still plagiarism?

Rigorous justification for non-relativistic QM perturbation theory assumptions?

How to not let the Identify spell spoil everything?

Possible issue with my W4 and tax return

Why is Shelob considered evil?

Taking an academic pseudonym?

Where does documentation like business and software requirement spec docs fit in an agile project?

How to align the top of the text with the top of a figure produced by tikz in minipage

Critique vs nitpicking

Reading Mishnayos without understanding

How do I narratively explain how in-game circumstances do not mechanically allow a PC to instantly kill an NPC?

Does it take energy to move something in a circle?

The No-Straight Maze

How do I avoid the "chosen hero" feeling?

What does からか mean?

Why does 0.-5 evaluate to -5?

What is an efficient way to digitize a family photo collection?

How can I deduce the power of a capacitor from its datasheet?

Is `Object` a function in javascript?

What's the reason that we have a different number of days each month?

Is it possible to rotate the Isolines on a Surface Using `MeshFunction`?

Co-worker sabotaging/undoing my work. (Software Development)



MySQL/MariaDB data directory backup


MySQL incremental backups per database (not global)Are ZRM (Zmanda Recovery Manager) incremental backups reliable?Incremental (not differential) backup of SQL Server 2008 R2MySQL Incremental backup on Master/SlaveMySQL backup of incremental changesetsOther databases deleted after restoring incremental MySQL Enterprise BackupMySQL restore only Incremental backups with innobackupexCan I create and restore partial backups with mariabackup on MariaDB 10.1.23?Incremetal backup using mysqldump in MySQLMariaDB Incremental Backup always creates full backup (mariabackup/xtrabackup)













1















I am using a solution of backblaze B2 / duplicity / duply to create backups of my databases. I upload full backups and incremental backups to B2 using duplicity via duply. The incrementals are done similar to rsync.



My server is 100GB and my databases are currently 70GB, but I don't suspect them to grow much. I dont have a master/slave setup. I want a backup solution that allows me to backup the 70GB of databases but not require very much space during the backup process.



I decided that I could just backup the whole /var/lib/mysql directory instead of using mysqldump or other backup methods which requires a full backup persist on disk.



I read that in order to do this method I would have to completely turn off the mysql server, do the backup, and turn it back on. I am OK with that because duplicity does incremental backups which should only take a few minutes.



I have ran SET GLOBAL innodb_max_dirty_pages_pct = 0; in order to make shutdown/starup as fast as can be and verified via show global status like '%dirty%'; that Innodb_buffer_pool_bytes_dirty hovers around 0.



I also understand the caveat for InnoDB tables is that they require the exact same mysql version in order to properly restore. Is that still the case?



Is there anything I am missing and will I have a near 100% confidence that if I use the exact mysql version (mariadb in my case) that at least one of my hundreds of incremental backups will restore.










share|improve this question
















bumped to the homepage by Community 8 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    1















    I am using a solution of backblaze B2 / duplicity / duply to create backups of my databases. I upload full backups and incremental backups to B2 using duplicity via duply. The incrementals are done similar to rsync.



    My server is 100GB and my databases are currently 70GB, but I don't suspect them to grow much. I dont have a master/slave setup. I want a backup solution that allows me to backup the 70GB of databases but not require very much space during the backup process.



    I decided that I could just backup the whole /var/lib/mysql directory instead of using mysqldump or other backup methods which requires a full backup persist on disk.



    I read that in order to do this method I would have to completely turn off the mysql server, do the backup, and turn it back on. I am OK with that because duplicity does incremental backups which should only take a few minutes.



    I have ran SET GLOBAL innodb_max_dirty_pages_pct = 0; in order to make shutdown/starup as fast as can be and verified via show global status like '%dirty%'; that Innodb_buffer_pool_bytes_dirty hovers around 0.



    I also understand the caveat for InnoDB tables is that they require the exact same mysql version in order to properly restore. Is that still the case?



    Is there anything I am missing and will I have a near 100% confidence that if I use the exact mysql version (mariadb in my case) that at least one of my hundreds of incremental backups will restore.










    share|improve this question
















    bumped to the homepage by Community 8 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      1












      1








      1








      I am using a solution of backblaze B2 / duplicity / duply to create backups of my databases. I upload full backups and incremental backups to B2 using duplicity via duply. The incrementals are done similar to rsync.



      My server is 100GB and my databases are currently 70GB, but I don't suspect them to grow much. I dont have a master/slave setup. I want a backup solution that allows me to backup the 70GB of databases but not require very much space during the backup process.



      I decided that I could just backup the whole /var/lib/mysql directory instead of using mysqldump or other backup methods which requires a full backup persist on disk.



      I read that in order to do this method I would have to completely turn off the mysql server, do the backup, and turn it back on. I am OK with that because duplicity does incremental backups which should only take a few minutes.



      I have ran SET GLOBAL innodb_max_dirty_pages_pct = 0; in order to make shutdown/starup as fast as can be and verified via show global status like '%dirty%'; that Innodb_buffer_pool_bytes_dirty hovers around 0.



      I also understand the caveat for InnoDB tables is that they require the exact same mysql version in order to properly restore. Is that still the case?



      Is there anything I am missing and will I have a near 100% confidence that if I use the exact mysql version (mariadb in my case) that at least one of my hundreds of incremental backups will restore.










      share|improve this question
















      I am using a solution of backblaze B2 / duplicity / duply to create backups of my databases. I upload full backups and incremental backups to B2 using duplicity via duply. The incrementals are done similar to rsync.



      My server is 100GB and my databases are currently 70GB, but I don't suspect them to grow much. I dont have a master/slave setup. I want a backup solution that allows me to backup the 70GB of databases but not require very much space during the backup process.



      I decided that I could just backup the whole /var/lib/mysql directory instead of using mysqldump or other backup methods which requires a full backup persist on disk.



      I read that in order to do this method I would have to completely turn off the mysql server, do the backup, and turn it back on. I am OK with that because duplicity does incremental backups which should only take a few minutes.



      I have ran SET GLOBAL innodb_max_dirty_pages_pct = 0; in order to make shutdown/starup as fast as can be and verified via show global status like '%dirty%'; that Innodb_buffer_pool_bytes_dirty hovers around 0.



      I also understand the caveat for InnoDB tables is that they require the exact same mysql version in order to properly restore. Is that still the case?



      Is there anything I am missing and will I have a near 100% confidence that if I use the exact mysql version (mariadb in my case) that at least one of my hundreds of incremental backups will restore.







      mysql innodb backup mariadb






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 22 '17 at 19:59







      ParoX

















      asked Apr 22 '17 at 18:29









      ParoXParoX

      1313




      1313





      bumped to the homepage by Community 8 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 8 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          How does duplicity do the "incremental" backups? By doing something like rsync? Or using MySQL's binlogs?



          One of the least invasive backups involves LVM.




          • About 1 minute of downtime, regardless of dataset size.

          • Only a few percent of disk space needed, regardless of dataset size. (10% might be more than generous.)

          • And, yet, you always get a full backup.


          How, you should ask? Obviously some kind of sleight of hand. Hint: a COW is involved.



          But, alas, you have to plan ahead and set up a "Logical Volume" for this to work with. And the OS has to provide such. Here's how it works:




          1. Set up the LV (one-time task)

          2. when you want to take a dump, do the following steps:

          3. stop mysqld

          4. take a "snapshot" of the entire disk (perhaps 1 minute)

          5. start mysqld


          6. now you get the slow tedious task of copying the entire snapshot to somewhere else.


          More info on the LV and the snapshot in the LV:




          • The snapshot is a "logical" copy of all the disk blocks.

          • It feels like a separate drive.

          • It takes very little extra space -- to start with

          • When either drive writes anything, the COW mooves into help. COW = Copy On Write. That is, the block that is being modified now needs to be come two blocks (and takes more real disk space). One drive keeps the old copy; one gets the new.

          • During your copy to elsewhere, the backup LV drive still sees only "old" blocks.

          • During your copy, mysqld continues to modify blocks, oblivious to the COW grazing in the background.

          • Well, there will be a lot of I/O due to the copy.


          Other notes...




          • Yes, it would be better to have exactly the same version.

          • You could install a newer version with the backup, but be sure to do mysql_upgrade. You could even test an upgrade right there in the snapshot -- without copying to elsewhere. (Note: the LV would need to be big enough for whatever changes in it.)

          • There is no concept of "incremental" (unless your copy is something like rsync).

          • Because I suggested actually stopping mysqld, there is no hard need for playing with %dirty%, etc. After all, InnoDB can recover from a power failure; this is more graceful than that.






          share|improve this answer
























          • The server is a VPS so LVM isn't very viable. Yes duplicity ( duplicity.nongnu.org ) is something like rsync. Thanks for the insight

            – ParoX
            Apr 22 '17 at 19:57











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "182"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f171732%2fmysql-mariadb-data-directory-backup%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          How does duplicity do the "incremental" backups? By doing something like rsync? Or using MySQL's binlogs?



          One of the least invasive backups involves LVM.




          • About 1 minute of downtime, regardless of dataset size.

          • Only a few percent of disk space needed, regardless of dataset size. (10% might be more than generous.)

          • And, yet, you always get a full backup.


          How, you should ask? Obviously some kind of sleight of hand. Hint: a COW is involved.



          But, alas, you have to plan ahead and set up a "Logical Volume" for this to work with. And the OS has to provide such. Here's how it works:




          1. Set up the LV (one-time task)

          2. when you want to take a dump, do the following steps:

          3. stop mysqld

          4. take a "snapshot" of the entire disk (perhaps 1 minute)

          5. start mysqld


          6. now you get the slow tedious task of copying the entire snapshot to somewhere else.


          More info on the LV and the snapshot in the LV:




          • The snapshot is a "logical" copy of all the disk blocks.

          • It feels like a separate drive.

          • It takes very little extra space -- to start with

          • When either drive writes anything, the COW mooves into help. COW = Copy On Write. That is, the block that is being modified now needs to be come two blocks (and takes more real disk space). One drive keeps the old copy; one gets the new.

          • During your copy to elsewhere, the backup LV drive still sees only "old" blocks.

          • During your copy, mysqld continues to modify blocks, oblivious to the COW grazing in the background.

          • Well, there will be a lot of I/O due to the copy.


          Other notes...




          • Yes, it would be better to have exactly the same version.

          • You could install a newer version with the backup, but be sure to do mysql_upgrade. You could even test an upgrade right there in the snapshot -- without copying to elsewhere. (Note: the LV would need to be big enough for whatever changes in it.)

          • There is no concept of "incremental" (unless your copy is something like rsync).

          • Because I suggested actually stopping mysqld, there is no hard need for playing with %dirty%, etc. After all, InnoDB can recover from a power failure; this is more graceful than that.






          share|improve this answer
























          • The server is a VPS so LVM isn't very viable. Yes duplicity ( duplicity.nongnu.org ) is something like rsync. Thanks for the insight

            – ParoX
            Apr 22 '17 at 19:57
















          0














          How does duplicity do the "incremental" backups? By doing something like rsync? Or using MySQL's binlogs?



          One of the least invasive backups involves LVM.




          • About 1 minute of downtime, regardless of dataset size.

          • Only a few percent of disk space needed, regardless of dataset size. (10% might be more than generous.)

          • And, yet, you always get a full backup.


          How, you should ask? Obviously some kind of sleight of hand. Hint: a COW is involved.



          But, alas, you have to plan ahead and set up a "Logical Volume" for this to work with. And the OS has to provide such. Here's how it works:




          1. Set up the LV (one-time task)

          2. when you want to take a dump, do the following steps:

          3. stop mysqld

          4. take a "snapshot" of the entire disk (perhaps 1 minute)

          5. start mysqld


          6. now you get the slow tedious task of copying the entire snapshot to somewhere else.


          More info on the LV and the snapshot in the LV:




          • The snapshot is a "logical" copy of all the disk blocks.

          • It feels like a separate drive.

          • It takes very little extra space -- to start with

          • When either drive writes anything, the COW mooves into help. COW = Copy On Write. That is, the block that is being modified now needs to be come two blocks (and takes more real disk space). One drive keeps the old copy; one gets the new.

          • During your copy to elsewhere, the backup LV drive still sees only "old" blocks.

          • During your copy, mysqld continues to modify blocks, oblivious to the COW grazing in the background.

          • Well, there will be a lot of I/O due to the copy.


          Other notes...




          • Yes, it would be better to have exactly the same version.

          • You could install a newer version with the backup, but be sure to do mysql_upgrade. You could even test an upgrade right there in the snapshot -- without copying to elsewhere. (Note: the LV would need to be big enough for whatever changes in it.)

          • There is no concept of "incremental" (unless your copy is something like rsync).

          • Because I suggested actually stopping mysqld, there is no hard need for playing with %dirty%, etc. After all, InnoDB can recover from a power failure; this is more graceful than that.






          share|improve this answer
























          • The server is a VPS so LVM isn't very viable. Yes duplicity ( duplicity.nongnu.org ) is something like rsync. Thanks for the insight

            – ParoX
            Apr 22 '17 at 19:57














          0












          0








          0







          How does duplicity do the "incremental" backups? By doing something like rsync? Or using MySQL's binlogs?



          One of the least invasive backups involves LVM.




          • About 1 minute of downtime, regardless of dataset size.

          • Only a few percent of disk space needed, regardless of dataset size. (10% might be more than generous.)

          • And, yet, you always get a full backup.


          How, you should ask? Obviously some kind of sleight of hand. Hint: a COW is involved.



          But, alas, you have to plan ahead and set up a "Logical Volume" for this to work with. And the OS has to provide such. Here's how it works:




          1. Set up the LV (one-time task)

          2. when you want to take a dump, do the following steps:

          3. stop mysqld

          4. take a "snapshot" of the entire disk (perhaps 1 minute)

          5. start mysqld


          6. now you get the slow tedious task of copying the entire snapshot to somewhere else.


          More info on the LV and the snapshot in the LV:




          • The snapshot is a "logical" copy of all the disk blocks.

          • It feels like a separate drive.

          • It takes very little extra space -- to start with

          • When either drive writes anything, the COW mooves into help. COW = Copy On Write. That is, the block that is being modified now needs to be come two blocks (and takes more real disk space). One drive keeps the old copy; one gets the new.

          • During your copy to elsewhere, the backup LV drive still sees only "old" blocks.

          • During your copy, mysqld continues to modify blocks, oblivious to the COW grazing in the background.

          • Well, there will be a lot of I/O due to the copy.


          Other notes...




          • Yes, it would be better to have exactly the same version.

          • You could install a newer version with the backup, but be sure to do mysql_upgrade. You could even test an upgrade right there in the snapshot -- without copying to elsewhere. (Note: the LV would need to be big enough for whatever changes in it.)

          • There is no concept of "incremental" (unless your copy is something like rsync).

          • Because I suggested actually stopping mysqld, there is no hard need for playing with %dirty%, etc. After all, InnoDB can recover from a power failure; this is more graceful than that.






          share|improve this answer













          How does duplicity do the "incremental" backups? By doing something like rsync? Or using MySQL's binlogs?



          One of the least invasive backups involves LVM.




          • About 1 minute of downtime, regardless of dataset size.

          • Only a few percent of disk space needed, regardless of dataset size. (10% might be more than generous.)

          • And, yet, you always get a full backup.


          How, you should ask? Obviously some kind of sleight of hand. Hint: a COW is involved.



          But, alas, you have to plan ahead and set up a "Logical Volume" for this to work with. And the OS has to provide such. Here's how it works:




          1. Set up the LV (one-time task)

          2. when you want to take a dump, do the following steps:

          3. stop mysqld

          4. take a "snapshot" of the entire disk (perhaps 1 minute)

          5. start mysqld


          6. now you get the slow tedious task of copying the entire snapshot to somewhere else.


          More info on the LV and the snapshot in the LV:




          • The snapshot is a "logical" copy of all the disk blocks.

          • It feels like a separate drive.

          • It takes very little extra space -- to start with

          • When either drive writes anything, the COW mooves into help. COW = Copy On Write. That is, the block that is being modified now needs to be come two blocks (and takes more real disk space). One drive keeps the old copy; one gets the new.

          • During your copy to elsewhere, the backup LV drive still sees only "old" blocks.

          • During your copy, mysqld continues to modify blocks, oblivious to the COW grazing in the background.

          • Well, there will be a lot of I/O due to the copy.


          Other notes...




          • Yes, it would be better to have exactly the same version.

          • You could install a newer version with the backup, but be sure to do mysql_upgrade. You could even test an upgrade right there in the snapshot -- without copying to elsewhere. (Note: the LV would need to be big enough for whatever changes in it.)

          • There is no concept of "incremental" (unless your copy is something like rsync).

          • Because I suggested actually stopping mysqld, there is no hard need for playing with %dirty%, etc. After all, InnoDB can recover from a power failure; this is more graceful than that.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 22 '17 at 19:37









          Rick JamesRick James

          42.9k22259




          42.9k22259













          • The server is a VPS so LVM isn't very viable. Yes duplicity ( duplicity.nongnu.org ) is something like rsync. Thanks for the insight

            – ParoX
            Apr 22 '17 at 19:57



















          • The server is a VPS so LVM isn't very viable. Yes duplicity ( duplicity.nongnu.org ) is something like rsync. Thanks for the insight

            – ParoX
            Apr 22 '17 at 19:57

















          The server is a VPS so LVM isn't very viable. Yes duplicity ( duplicity.nongnu.org ) is something like rsync. Thanks for the insight

          – ParoX
          Apr 22 '17 at 19:57





          The server is a VPS so LVM isn't very viable. Yes duplicity ( duplicity.nongnu.org ) is something like rsync. Thanks for the insight

          – ParoX
          Apr 22 '17 at 19:57


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Database Administrators Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f171732%2fmysql-mariadb-data-directory-backup%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Szabolcs (Ungheria) Altri progetti | Menu di navigazione48°10′14.56″N 21°29′33.14″E /...

          Discografia di Klaus Schulze Indice Album in studio | Album dal vivo | Singoli | Antologie | Colonne...

          How to make inet_server_addr() return localhost in spite of ::1/128RETURN NEXT in Postgres FunctionConnect to...