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

This operation is used to create a backup task by using the backup feature of ApsaraDB RDS. You can also create a backup task 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 cannot have an ongoing backup task.
  • The number of backup tasks that are created for the instance on the day cannot reach 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 You can specify this parameter when you perform a logical backup on the individual databases of an ApsaraDB RDS for MySQL instance. You can also specify this parameter when you perform a full physical backup on the individual databases of an ApsaraDB RDS for SQL Server instance.
BackupStrategy String No db

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

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

The type of 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.
  • When you perform a snapshot backup on an ApsaraDB RDS for SQL Server instance that uses standard or enhanced SSDs, you must set this parameter to Snapshot.
BackupType String No Auto

The method that you want to use for the backup task. 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 set this parameter only when the instance runs the SQL Server database engine.
  • This parameter only takes effect when the BackupMethod parameter is set to Physical.

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.