Using Xtradb Backup

Posted in: MySQL, Technical Track

As Baron points out, Percona’s Xtrabackup tool can be used just like InnoDB Hot Backup.

Many are wondering, “is it good enough?” In fact, I wondered the same thing, and after a few weeks of using and testing Xtrabackup (on machines that have MyISAM and InnoDB tables), I can say:

0) We have not run into any problems with backing up InnoDB tables; on the machines we’ve run it on (RHEL 5.3 and Debian) it has been stable.

1) We were able to use one of the binaries provided by Percona — we did not have to compile anything. Binaries are provided for 64-bit versions of Linux

2) Innobackupex is the script analogous to Innobackup. Basically, this is a wrapper script for Xtrabackup that will copy the non-InnoDB tables.

3) Usually we run InnoDB Hot Backup from a non-privileged user. We had to run Xtrabackup as the mysql user; we think this is because it writes a state file in the datadir, but we did not dig too hard — once we saw that running it from the mysql user worked, we just left it like that.

4) Xtrabackup does not have a –compress option like InnoDB hot backup does. Having the option would be useful, but I believe this option will come soon.

Currently, for clients who want a hot backup solution but do not want to pay for InnoDB Hot Backup, Pythian recommends Xtrabackup.


Interested in working with Sheeri? Schedule a tech call.

6 Comments. Leave new

While there’s no compress option supported yet, you can stream your backup to gzip:

#> innobackupex –user=foo –password=bar –stream=tar ./ | gzip – > /path/to/backup.tar.gz

I haven’t tested it extensively, but it worked for me.


Hi Sheeri,

I think it’s worthwhile mentioning that Xtrabackup allows for streaming: you can pipe the backup into | tar, | ssh, what have you.
I think this must be one of its simple yet big advantages. ibbackup requires enough local or nfs mounted disk space, while xtrabackup allows for easy network backup. (with ibbackup it’s even worse when restoring from backup: it actually requires the backup and restored files to be on the same directory).



We discussed this offline first and Sheeri asked me to post a comment.
The current RHEL/CentOS binaries include a bug where the innodb datadir is incorrectly handled. It is a fixed bug but not in the binaries available.

To get around this I successfully built the rc-0.7 from the source, following the instructions on the xtrabackup website. The main issues with building was building MySQL from the source (not xtrabackup).

Evgeniy, Yasufumi et al, please bite the bullet and release official binaries for rc-0.7

This is bleeding edge software. If you are going to use it in a production environment you need to fully aware that bugs will exist.

Have Fun



Discussed this with Paul and Sheeri based on some project for clients and I need to add a few items I found:

* innobackupex script is limited in the type of options you can specify compared to what the xtrabackup executable supports. I find this annoying since it limits the directories where you can have the backups, data directories and logs. I’m exploring the possibility of creating a ZRM pluging that should get rid of these limitations.

* Xtrabackup doesn’t work for MySQL v4.1. In the Percona forums there was a suggestion that the 5.0 patch should work. This is true, but xtrabackup.c has other dependencies on 5.x definitions and structures I didn’t have time to review. Baron Schwartz correctly suggested that these dependencies might be trivial in a tweet directed to myself. I’ll post my findings to the Percona forums and hopefully we can soon have a patched version.


I’ve been trying to install xtrabackup/innobackupex for a customer and I’m finding a few glitches, especially w/ streaming:

We use innoback(ex) wrapped in our own scripts to allow for rotation and other operations. We also use ZRM for some installations, so this would apply to integration with this tool as well. These are the glitches I found:

1. Using streaming by piping it into ‘gzip’ masks the return code from Since gzip will almost always return 0, you can’t rely on it to determine backup success.

2. The next alternative would be to review the’s output for the OK at the end. But since it redirects the output to ‘stderr’ to allow for streaming, you need to add “2> innobackupex.log” before piping and grep for the “OK” at the end.

3. As Sheeri pointed out, the need to run it as user ‘mysql’ seems to come from the fact that it requires ‘write’ privileges for at least some of the ‘ibdata*’ files. I don’t feel quite comfortable with this requirement since it’s not necessary for ‘’

My $.02


Leave a Reply

Your email address will not be published. Required fields are marked *