Documentation Home
MySQL Enterprise Backup 9.0 User's Guide
Related Documentation Download this Manual
PDF (US Ltr) - 1.3Mb
PDF (A4) - 1.3Mb


4.3.1.3 Backing Up to Cloud Storage

MySQL Enterprise Backup supports cloud backups. Only single-file backups can be created on and restored from a 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 backups or restores.

Note

See Appendix B, Limitations of MySQL Enterprise Backup for some limitations regarding the support for cloud storage by mysqlbackup.

MySQL Enterprise Backup supports the following types of cloud storage services:

  • Oracle Cloud Infrastructure (OCI) Object Storage

  • OpenStack Swift or compatible object storage services

  • Amazon Simple Storage Service (S3) or compatible storage service.

  • GCP object storage

A cloud backup is created using the cloud options for mysqlbackup, which are described in details in Section 20.15, “Cloud Storage Options”. Here are some sample commands for creating a cloud backup:

Example 4.16 Creating a Cloud Backup on Oracle Cloud Infrastructure Object Storage

This example creates a cloud backup in an Oracle Cloud Infrastructure (OCI) Object Storage bucket using a Pre-Authenticated Request (PAR) URL.

mysqlbackup --defaults-file=/home/dbadmin/my.cnf  --backup-dir=/home/dbadmin/backuptmp \ 
  --with-timestamp --backup-image=- --cloud-service=OCI --cloud-par-url=<bucket_PAR_URL> --cloud-object=backup.bk \
backup-to-image


Example 4.17 Creating a Cloud Incremental Backup on Oracle Cloud Infrastructure

This example creates an incremental cloud backup in an Oracle Cloud Infrastructure (OCI) Object Storage bucket, using a Pre-Authenticated Request (PAR) URL.

mysqlbackup --defaults-file=/home/dbadmin/my.cnf --backup-dir=/home/dbadmin/backuptmp --with-timestamp \ 
  --backup-image=- --cloud-service=OCI --cloud-par-url=<bucket_PAR_URL> --cloud-object=backup-inc.bk  \ 
--incremental --incremental-base=history:last_backup backup-to-image


Example 4.18 Creating a Cloud Backup on an OpenStack Object Storage

This example creates a cloud backup on an OpenStack object storage, using the Keystone identity service to authenticate the user's credentials.

mysqlbackup \
--defaults-file=/home/dbadmin/my.cnf \
--include-tables=testdb.t1 --use-tts=with-full-locking \
--cloud-service=openstack  --cloud-container=<swift container> \
--cloud-user-id=<keystone user> --cloud-password=<keystone password> \
--cloud-region=<keystone region> --cloud-tenant=<keystone tenant> \
--cloud-identity-url=<keystone url>  \
--cloud-trace=1 --cloud-object=image_800.mbi \
--backup-dir=/home/dba/opbackuptmpdir \
--backup-image=- \
backup-to-image


Example 4.19 Creating a Cloud Backup in an Amazon S3 Bucket

This example creates a cloud backup in an Amazon S3 bucket.

mysqlbackup\
--defaults-file=/home/dbadmin/my.cnf \
--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/dba/s3backupdir --with-timestamp \
--backup-image=- \
backup-to-image


Example 4.20 Creating a Cloud Incremental Backup in an Amazon S3 Bucket

This example creates a cloud incremental backup in an Amazon S3 bucket.

mysqlbackup\
--defaults-file=/home/dbadmin/my.cnf \
--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/dba/s3backupdir --with-timestamp \
--backup-image=- --incremental --incremental-base=history:last_backup \
backup-to-image


Example 4.21 Creating a Cloud Backup on GCP Storage Service

This example creates a cloud backup on GCP storage service.

mysqlbackup\
--defaults-file=/home/dbadmin/my.cnf \
--cloud-service=GCP \
--cloud-bucket=<bucket name> --cloud-object=<object name> \
--cloud-access-key=<access name> --cloud-secret-key=<secret key> \
--backup-dir=/home/dba/backupdir --with-timestamp \
--backup-image=- \
backup-to-image


A cloud backup always uses one write thread.

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 with cloud storage (see Appendix B, Limitations of MySQL Enterprise Backup for some restrictions).

See Section 5.2, “Restoring a Backup from Cloud Storage to a MySQL Server” on how to restore a backup image from a cloud storage.