1. Building XtraBackup for Mac OS

Building XtraBackup for Mac OS

Percona XtraBackup is free and open source backup tool for MySQL. Percona distributes XtraBackup via package repositories for RedHat and Debian.

Unfortunately there are no packages for Mac OS. In this post I will describe how to build XtraBackup for Mac OS.

Dependencies

To build and use XtraBackup on Mac OS you need to install some additional packages. I will use MacPorts to install the dependencies.

Building XtraBackup for Mac OS

Download the source code from https://www.percona.com/downloads/XtraBackup/LATEST/

Untar the archive:

Build the binaries.

XtraBackup comes with a perl script innobackupex that can be found in storage/innobase/xtrabackup/. The script is a wrapper around few binaries XtraBackup needs to work. They are built in storage/innobase/xtrabackup/src: xbcrypt, xbstream and xtrabackup.

Installing XtraBackup for Mac OS

To install XtraBackup use a Makefile:

It will install XtraBackup in /usr/local/xtrabackup/ . The binaries will be placed in /usr/local/xtrabackup/bin/ so make sure it’s in the $PATH.

XtraBackup Package

For your convenience we built and packaged XtraBackup for Mac OS. The package installs the binaries in /opt/local/bin which should be in your $PATH. I tested XtraBackup on OS X 10.10 Yosemite.

Have a question? Ask the experts!

Previous Post Next Post
  • Thanks for posting this, was a huge help putting this together. If you just replace the version numbers in the scripts, will this continue to work for future releases?

    • I think the build procedure will work for further 2.2.x releases.
      There are many changes in 2.3, so it may be different.

  • Thanks for posting this, was a huge help putting this together. If you just replace the version numbers in the scripts, will this continue to work for future releases?

    • I think the build procedure will work for further 2.2.x releases.
      There are many changes in 2.3, so it may be different.

  • 2ge

    Thanks for this, really appreciate that, going to try it on DEV OSX machine. I downloaded XtraBackup 2.2.11 package, it is installing into /opt/local/bin. I think, much more standard way is /usr/local/bin – so if possible, change it in future.

    Also, without “brew install libgcrypt” it doesnt work. I build it from the sources too, and that work.

    • Thanks for feedback. I added some dependencies to the package. Apparently I missed libgcrypt.

  • 2ge

    Thanks for this, really appreciate that, going to try it on DEV OSX machine. I downloaded XtraBackup 2.2.11 package, it is installing into /opt/local/bin. I think, much more standard way is /usr/local/bin – so if possible, change it in future.

    Also, without “brew install libgcrypt” it doesnt work. I build it from the sources too, and that work.

    • Thanks for feedback. I added some dependencies to the package. Apparently I missed libgcrypt.