Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Any way to do incremental mysql backup
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Any way to do incremental mysql backup

dnwkdnwk Member

Is there anyway to backup a Mysql database with daily Incremental? I don't want to run mysqldump too often as it took too much resources and the database is large. Is there anyway that I can run a full backup of the database at the beginning and then incremental?

Comments

  • How about setting up a slave server?

  • Ever since MySQL 4.0 you've been able to do an incremental backup using mysqldump. That being said, depending on your data structure I would advise on using a technique coined as 'smart dumping' instead, where you only dump what you know is new.

    This method requires you to know the schema of your database, such as if you wrote the application in question; and is completely incompatible with SolusVM, WHMCS, and a lot of skiddy systems due to their lack of intelligence and design when it comes to the database.

    The idea behind it is simple: [psuedocode]

    let LastID equal IDofLastDumpedRecord
    let LastUpdate equal LastUpdateTime
    
    for records where record.ID > LastID
      dump record
    
    for records where record.LastUpdate > LastUpdate
      dump record
    

    This technique is sufficient in cases where you know that your data will not update without the lastupdate time changing, and that all new records will have a greater ID than the previous records (ie: any sane data structure.) This technique is also much faster (depending on the language done in***) than using incremental mysqldump as it does not require a fullscan on the database. The "ID" should be a primary key in this example for the best possible results.

    Thanked by 1ironhide
  • @taronyu said:
    How about setting up a slave server?

    I use to use Slave MySQL. However, it is very easy for it to be out of sync.

  • That's only for MySQL 3.7. It is no longer exist for 5.5

  • @HardCloud said:
    Ever since MySQL 4.0 you've been able to do an incremental backup using mysqldump. That being said, depending on your data structure I would advise on using a technique coined as 'smart dumping' instead, where you only dump what you know is new.

    em... That's something pretty painful to setup.

  • Anybody use Percona XtraBackup before?

  • @dnwk said:
    Anybody use Percona XtraBackup before?

    Yes, on a daily basis. The other Percona tools are also very nice (for instance, you can checksum test your slave on a regular basis to detect out of sync).

  • @Chumbi said:
    Yes, on a daily basis. The other Percona tools are also very nice (for instance, you can checksum test your slave on a regular basis to detect out of sync).

    Have you tried the incremental feature?

  • ChumbiChumbi Member
    edited January 2014

    I don't use the incremental feature of XtraBackup because incremental w/ XtraBackup only works with innodb. But the databases I am backing up are mixed (innodb and myisam).

  • maybe mysql replication with a dump backup script on a crontab?

  • ChumbiChumbi Member
    edited January 2014

    If you want something like incremental, I suggest you take a look at "mysqlbinlog --raw" (mysql must be 5.6+). It makes raw copies of the binlogs (master must use them) in real-time.... meaning you can go back in time at any point.

    [Edit] linky for more details: http://dev.mysql.com/doc/refman/5.6/en/mysqlbinlog-backup.html

  • ZFS is the way to go for snapshots/backups.

  • Along the same lines as the binlog is Zmanda Recovery Manager.

  • joepie91joepie91 Member, Patron Provider

    Can always just use some method of dumping into SQL format, plus Git :)

  • @joepie91 said:
    Can always just use some method of dumping into SQL format, plus Git :)

    Right !

  • @joepie91 said:
    Can always just use some method of dumping into SQL format, plus Git :)

    So what method you can dumping into SQL without pushing server load to 2.5?

Sign In or Register to comment.