mysqlmybackup.sh – multi feature MySQL database backup and restore script with Percona XtraBackup & Mydumper tool support
- Percona Xtrabackup based backup method which is useful for mixed MyISAM/InnoDB backups as well.
- I’ve only coded the script to use innobackupex-1.5.1 as majority of vBulletin and wordpress sites I run still use MyISAM storage engine rather than InnoDB.
- There’s an outstanding Percona XtraBackup bug where MariaDB 5.2.x (and MariaDB 5.3) branch of MySQL server versions isn’t properly recognised by XtraBackup’s innobackupex-1.5.1 script. You’ll need to patch innobackupex-1.5.1 with the fix for both MariaDB 5.2 and 5.3 which I uploaded here. Without the patch, MariaDB 5.2/5.3 will give the following error message when you run innobackupex-1.5.1 complaining that the ibbackup child process has died at /usr/bin/innobackupex-1.5.1 line 336:
Backing up database: [sbtest] if mysql user password is empty hit enter at prompt 134MB 0:00:08 [16.5MB/s] [ <=> ] Successfully backed up database: sbtest
Percona XtraBackup is an open-source hot backup utility for MySQL that doesn’t lock your database during the backup. It can back up data from InnoDB, XtraDB, and MyISAM tables on MySQL 5.0 and newer servers, and it has many advanced features.
Percona XtraBackup is a combination of the xtrabackup C program, and the innobackupex Perl script. The xtrabackup program copies and manipulates InnoDB and XtraDB data files, and the Perl script enables enhanced functionality, such as interacting with a running MySQL server and backing up MyISAM tables. XtraBackup works with unmodified MySQL servers, as well as Percona Server with XtraDB. It runs on Linux, Windows, and FreeBSD.