Buy Percona ServicesBuy Now!

The xbcloud Binary


This feature implementation is considered ALPHA quality.

xbcloud is a new tool which is part of the Percona XtraBackup 2.3.2 release. The purpose of xbcloud is to download and upload full or part of xbstream archive from/to cloud. xbcloud will refuse to overwrite the backup with the same name.

xbcloud stores each chunk as a separate object with name backup_name/database/table.ibd.NNNNNNNNNNNNNNNNNNNN, where NNN... is a 0-padded serial number of chunk within file. Size of chunk produced by xtrabackup and xbstream changed to 10M.

Version specific information

  • 2.3.0-alpha1 - Initial implementation
  • 2.3.1-beta1 - Implemented ability to store xbcloud parameters in a .cnf file
  • 2.3.1-beta1 - Implemented support different authentication options for Swift
  • 2.3.1-beta1 - Implemented support for partial download of the cloud backups
  • 2.3.1-beta1 - --swift-url option has been renamed to --swift-auth-url



xtrabackup --backup --stream=xbstream --target-dir=/tmp | xbcloud \
put [options] <name>

Following example shows how to make a full backup and upload it to Swift:

xtrabackup --backup --stream=xbstream --extra-lsndir=/tmp --target-dir=/tmp | \
xbcloud put --storage=Swift \
--swift-container=test \
--swift-user=test:tester \
--swift-auth-url= \
--swift-key=testing \
--parallel=10 \


xbcloud get [options] <name> [<list-of-files>] | xbstream -x

Following example shows how to fetch and restore the backup from Swift:

xbcloud get --storage=Swift \
--swift-container=test \
--swift-user=test:tester \
--swift-auth-url= \
--swift-key=testing \
full_backup | xbstream -xv -C /tmp/downloaded_full

xtrabackup --prepare --target-dir=/tmp/downloaded_full
xtrabackup --copy-back --target-dir=/tmp/downloaded_full

Incremental backups

Taking incremental backups:

First you need to make the full backup on which the incremental one is going to be based:

xtrabackup --backup --stream=xbstream --extra-lsndir=/storage/backups/ \
--target-dir=/storage/backups/ | xbcloud put \
--storage=swift --swift-container=test_backup \
--swift-auth-version=2.0 --swift-user=admin \
--swift-tenant=admin --swift-password=xoxoxoxo \
--swift-auth-url= --parallel=10 \

Then you can make the incremental backup:

xtrabackup --backup --incremental-basedir=/storage/backups \
--stream=xbstream --target-dir=/storage/inc_backup | xbcloud put \
--storage=swift --swift-container=test_backup \
--swift-auth-version=2.0 --swift-user=admin \
--swift-tenant=admin --swift-password=xoxoxoxo \
--swift-auth-url= --parallel=10 \

Preparing incremental backups:

To prepare the backup you first need to download the full backup:

xbcloud get --swift-container=test_backup \
--swift-auth-version=2.0 --swift-user=admin \
--swift-tenant=admin --swift-password=xoxoxoxo \
--swift-auth-url= --parallel=10 \
full_backup | xbstream -xv -C /storage/downloaded_full

Once you download full backup it should be prepared:

xtrabackup --prepare --apply-log-only --target-dir=/storage/downloaded_full

After the full backup has been prepared you can download the incremental backup:

xbcloud get --swift-container=test_backup \
--swift-auth-version=2.0 --swift-user=admin \
--swift-tenant=admin --swift-password=xoxoxoxo \
--swift-auth-url= --parallel=10 \
inc_backup | xbstream -xv -C /storage/downloaded_inc

Once the incremental backup has been downloaded you can prepare it by running:

xtrabackup --prepare --apply-log-only \
--target-dir=/storage/downloaded_full \

xtrabackup --prepare --target-dir=/storage/downloaded_full

Partial download of the cloud backup

If you don’t want to download entire backup to restore the specific database you can specify only tables you want to restore:

xbcloud get --swift-container=test_backup
--swift-auth-version=2.0 --swift-user=admin \
--swift-tenant=admin --swift-password=xoxoxoxo \
--swift-auth-url= full_backup \
ibdata1 sakila/payment.ibd \
> /storage/partial/partial.xbs

xbstream -xv -C /storage/partial < /storage/partial/partial.xbs

This command will download just ibdata1 and sakila/payment.ibd table from the full backup.

Command-line options

xbcloud has following command line options:


Cloud storage option. Only support for Swift is currently implemented. Default is Swift


URL of Swift cluster.


xbcloud will try to get object-store URL for given region (if any specified) from the keystone response. One can override that URL by passing –swift-storage-url=URL argument.


Swift username (X-Auth-User, specific to Swift)


Swift key/password (X-Auth-Key, specific to Swift)


Container to backup into (specific to Swift)


Maximum number of concurrent upload/download threads. Default is 1.


Path to the file with CA certificates


Do not verify servers certificate

Swift authentication options

Swift specification describe several authentication options. xbcloud can authenticate against keystone with API version 2 and 3.


Specifies the swift authentication version. Possible values are: 1.0 - TempAuth, 2.0 - Keystone v2.0, and 3 - Keystone v3. Default value is 1.0.

For v2 additional options are:


Swift tenant name.


Swift tenant ID.


Swift endpoint region.


Swift password for the user.

For v3 additional options are:


Swift user ID.


Swift project name.


Swift project ID.


Swift domain name.


Swift domain ID.

Visit Percona Store

General Inquiries

For general inquiries, please send us your question and someone will contact you.