1. How to Backup MySQL 5.7

How to Backup MySQL 5.7

If you ever tried to backup MySQL 5.7 with Percona Xtrabackup that comes in percona-xtrabackup package most likely you got error message like this:

This happens because percona-xtrabackup actually installs version 2.3 that doesn’t support MySQL 5.7.

To take copies from MySQL 5.7 you need to use Percona XtraBackup version 2.4 and higher.

Starting from version 2.13.0 TwinDB Backup uses Percona XtraBackup 2.4 to backup MySQL 5.7, 5.6 and earlier versions.

Configuring Repositories

For Debian based systems run following script:

For RedHat based systems run this:

Installing TwinDB Backup

For TwinDB Backup just install package twindb-backup.

Package percona-xtrabackup-24 conflicts with percona-xtrabackup. So if you get the error just uninstall percona-xtrabackup.

Configuring TwinDB Backup

There are many ways to configure backups. See documentation for more detailed description of options in the configuration file.

Along with MySQL database I prefer to take copies of /etc/ as well. As the destination S3 is probably the obvious choice. So, the configuration file /etc/twindb/twindb-backup.cfg should look something like this:

Test run

TwinDB Backup package installs a cron job, so you could let it run and check the backups an hour later. Or you can run it manually of course to make sure everything is configured correctly.

If success the tool should not produce any output. If any errors drop me a message on support@twindb.com.

Backups verification

You don’t have backups if you don’t verify them. Unfortunately too many users learned this lesson hard way. So don’t be that user and do verify your backups.

TwinDB Backup is super friendly when it comes to restoring backup copies. It will take care of full or incremental backups, local or remote copies.

First step in the verification process is to check what backups we actually have:

Ok, we have some copies on the local and remote storage. Let’s grab and restore the last hourly copy:

So the backup copy is restored successfully.
To be absolutely sure the backup copy is usable I’d recommend to run a test instance on /var/lib/mysql_restored and run some queries to make sure the data is there.

Previous Post Next Post