You can call the CreateBackup operation to create a backup file for an instance.

This operation uses the backup feature of ApsaraDB RDS to create a backup file. You can also use an operation of Database Backup (DBS) to create a backup file.

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

  • The instance is in the Running state.
  • The instance does not have ongoing backup tasks.
  • The number of backup files that are created per day for an instance cannot 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

ParameterTypeRequiredExampleDescription
ActionStringYesCreateBackup

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

DBInstanceIdStringYesrm-uf6wjk5****

The ID of the instance.

DBNameStringNords_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 individual databases of an ApsaraDB RDS for MySQL instance. You can also specify this parameter when you perform a full physical backup on individual databases of an ApsaraDB RDS for SQL Server instance.
BackupStrategyStringNodb

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

  • db: a database-level backup.
  • instance: 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.
BackupMethodStringNoPhysical

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 SSDs or enhanced SSDs (ESSD), you must set this parameter to Snapshot.
BackupTypeStringNoAuto

The backup method. Valid values:

  • Auto: The system determines whether to perform a full or incremental backup
  • FullBackup: full backup.

Default value: Auto.

Note
  • You must set this parameter only when the instance runs the SQL Server database engine.
  • This parameter is valid only when the BackupMethod parameter is set to Physical.
ResourceGroupIdStringNorg-acfmy*****

The ID of the resource group.

Response parameters

ParameterTypeExampleDescription
BackupJobIdString5073731

The ID of the backup task.

RequestIdString2C125605-266F-41CA-8AC5-3A643D4F42C5

The ID of the request.

Examples

Sample requests

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

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<?xml version="1.0" encoding="UTF-8" ?>
<CreateBackupResponse>
    <RequestId>2C125605-266F-41CA-8AC5-3A643D4F42C5</RequestId>
    <BackupJobId>5073731</BackupJobId>
</CreateBackupResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

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

Error codes

HTTP status codeError codeError messageDescription
403OperationDenied.ApiForbiddenoperation not permitted.The error message returned because the current operation is not supported.

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