You can call the CreateBackup operation to create a data backup for an ApsaraDB RDS instance

This operation is used to create a data backup by using the backup feature of ApsaraDB RDS. You can also create a data backup by using Database Backup (DBS). For more information, see List of operations by function.

Before you call this operation, make sure that the following requirements are met:

  • The instance must be in the Running state.
  • The instance does not have an ongoing backup task.
  • The maximum number of data backups that can be created per day on the instance does not exceed 20.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateBackup

The operation that you want to perform. Set the value to CreateBackup.

DBInstanceId String Yes rm-uf6wjk5xxxxxxx

The ID of the instance.

DBName String No rds_mysql

The names of the databases whose data you want to back up. Separate the names of the databases with commas (,).

Note When you perform a logical backup on the individual databases of an ApsaraDB RDS for MySQL instance or when you perform a full physical backup on the individual databases of an ApsaraDB RDS for SQL Server instance, you can specify this parameter.
BackupStrategy String No db

The policy that you want to use for the data backup. Valid values:

  • db: specifies to perform a database-level data backup.
  • instance: specifies to perform an instance-level data backup.
Note When you perform a logical backup on an ApsaraDB RDS for MySQL instance or when you perform a full physical backup on an ApsaraDB RDS for SQL Server instance, you can specify this parameter.
BackupMethod String No Physical

The type of data backup that you want to perform. Valid values:

  • Logical: logical backup
  • Physical: physical backup
  • Snapshot: snapshot backup

Default value: Physical.

Note
  • You can perform a logical backup only when databases are created on the instance.
  • When you perform a snapshot backup on an ApsaraDB RDS for MariaDB instance, you must set this parameter to Physical.
  • For more information about the supported backup types, see Back up an ApsaraDB RDS for MySQL instance.
BackupType String No Auto

The method that you want to use for the data backup. Valid values:

  • Auto: specifies to automatically perform a full or incremental backup.
  • FullBackup: specifies to perform a full backup.

Default value: Auto.

Note You must specify this parameter only when the instance runs the SQL Server database engine.

Response parameters

Parameter Type Example Description
BackupJobId String 5073731

The ID of the backup task.

RequestId String 2C125605-266F-41CA-8AC5-3A643D4F42C5

The ID of the request.

Examples

Sample requests

http(s)://rds.aliyuncs.com/? Action=CreateBackup
&DBInstanceId=rm-uf6wjk5xxxxxxx
&<Common request parameters>

Sample success responses

XML format

<CreateBackupResponse>
	  <RequestId>2C125605-266F-41CA-8AC5-3A643D4F42C5</RequestId>
	  <BackupJobId>5073731</BackupJobId>
</CreateBackupResponse>

JSON format

{
    "RequestId": "2C125605-266F-41CA-8AC5-3A643D4F42C5", 
    "BackupJobId": "5073731"
}

Error codes

For a list of error codes, visit the API Error Center.