What is the best way to do incremental backups in

2019-01-11 23:28发布

We are using MySQL version 5.0 and most of the tables are InnoDB. We run replication to a slave server. We are thinking of backing up the MySQL log files on a daily basis.

Questions

  • Is there any other way of doing an incremental backup without using the log files?
  • What are the best practices when doing incremental backups?

2条回答
该账号已被封号
2楼-- · 2019-01-12 00:01

You can dump your schemas regularly with mysqldump, using always the same file name and path for each schema (i.e. replacing the latest one)

Then combine that with any backup tool that supports incremental/delta backup, for example rdiff-backup, duplicity, Duplicati or Areca Backup. An example from duplicity docs:

Because duplicity uses librsync, the incremental archives are space efficient and only record the parts of files that have changed since the last backup

That way your first backup would be the compressed copy of the 1st full dump, and the second would contain the compressed differences from the 1st and 2nd dump and so on. You can restore the mysqldump file of any point in time and then restore that file into MySQL.

查看更多
成全新的幸福
3楼-- · 2019-01-12 00:26

AFAIK the only way of doing incremental backups is by using the binary-log. You have other options if you want to do full backups (InnoDB hotcopy), but incremental means that you need to log all transactions made.

You need to ask yourself why you're backing up data. Since you have a slave for replication, I assume the backup is primarly for reverting data in case of accidental deletion?

I would probably rotate the logs every 1 hour and take a backup of it. Meaning, restoring would leave the data at most 1 hour old, and you can restore to any point in time since the last full snapshot.

查看更多
登录 后发表回答