3.3.5.3 Backing Up to Cloud Storage

MySQL Enterprise Backup supports cloud backup since version 3.10.2.

Only single-file backups can be created on and restored from cloud storage. All mysqlbackup options compatible with single-file operations (including, for example, the --incremental, --compression, --partial, and --encryption options) can be used with cloud backup or restoration.

Currently, Amazon S3 is the only cloud service supported by MySQL Enterprise Backup.

A cloud backup is created using the cloud options for mysqlbackup, which are described in details in Section 5.1.15, “Cloud Storage Options”. This is a sample command for creating a cloud backup:

Example 3.16 Creating a Cloud Backup

mysqlbackup\
--cloud-service=s3 --cloud-aws-region=<aws region> \
--cloud-access-key-id=<aws access key id> --cloud-secret-access-key=< aws secret access key> \
--cloud-bucket=<s3 bucket name> --cloud-object-key=<aws object key> \
--backup-dir=/home/user/dba/s3backuptmpdir \
--backup-image=- \
backup-to-image


Besides backup-to-image, all other mysqlbackup operations for single-file backups (backup-dir-to-image, list-image, validate, image-to-backup-dir, extract, copy-back, and copy-back-and-apply-log) can also be performed using cloud storage.

Example 3.17 Extract an Existing Image from Cloud Storage to Backup Directory

Extract a backup image from cloud storage, using the --backup-dir option to specify the directory into which the image will be extracted:

mysqlbackup\
--cloud-service=s3 --cloud-aws-region=<aws region> \
--cloud-access-key-id=<aws access key id> --cloud-secret-access-key=< aws secret access key> \
--cloud-bucket=<s3 bucket name> --cloud-object-key=<aws object key> \
--backup-dir=/home/user/dba/s3backuptmpdir \
--backup-image=- \
image-to-backup-dir


See Example 4.8, “Restoring a Single-file Backup from Cloud Storage to a MySQL Server” on how to restore a backup image from a cloud storage.