Skip to content

Use the xbcloud binary with Swift

Create a full backup with Swift

The 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 \

The following OpenStack environment variables are also recognized and mapped automatically to the corresponding swift parameters (--storage=swift):













Restore with Swift

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

The 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

$ xbcloud delete --storage=swift --swift-user=xtrabackup \
--swift-password=xtrabackup123! --swift-auth-version=3 \
--swift-auth-url= \
--swift-container=mybackup1 --swift-domain=Default

Command-line options

xbcloud has the following command line options:


Cloud storage option. xbcloud supports Swift, MinIO, and AWS S3. The default value is swift.


The URL of the Swift cluster


The xbcloud tries to get the object-store URL for a given region (if any are specified) from the keystone response. You can override that URL by passing –swift-storage-url=URL argument.


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


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


The container to back up into (specific to Swift)


The maximum number of concurrent upload/download requests. The default value is 1.


The path to the file with CA certificates


Do not verify server’s certificate

Swift authentication options

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


Specifies the swift authentication version. The possible values are: 1.0 - TempAuth, 2.0 - Keystone v2.0, and 3 - Keystone v3. The 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

Get expert help

If you need assistance, visit the community forum for comprehensive and free database knowledge, or contact our Percona Database Experts for professional support and services.

Last update: 2024-06-12