All Products
Search
Document Center

Data Management:CreateRestoreTask

Last Updated:Apr 24, 2026

This operation creates a DBS restore task.

Operation description

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dbs:CreateRestoreTask

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

BackupPlanId

string

Yes

The ID of the backup plan.

dbs1hvb0ww****

DestinationEndpointInstanceType

string

Yes

The type of the destination endpoint. Valid values:

  • RDS: an ApsaraDB RDS instance.

  • ECS: a self-managed database hosted on an ECS instance.

  • Express: a database connected over a leased line, VPN Gateway, or Smart Access Gateway.

  • Agent: a database connected via a backup gateway.

  • DDS: an ApsaraDB for MongoDB (DDS) instance.

  • Other: a database connected over the internet by using a public IP address and port.

  • dg: a self-managed database without a public endpoint, connected via Database Gateway.

RDS

DestinationEndpointRegion

string

No

The region ID of the destination database instance.

Note

This parameter is required when DestinationEndpointInstanceType is set to RDS, ECS, DDS, Express, or Agent.

cn-hangzhou

DestinationEndpointInstanceID

string

No

The ID of the destination database instance.

Note

This parameter is required when DestinationEndpointInstanceType is set to RDS, ECS, DDS, or Express.

rm-bp1p8c29*****

DestinationEndpointIP

string

No

The endpoint of the destination database.

Note

This parameter is required when DestinationEndpointInstanceType is set to Express, Agent, or Other.

rm-bp*****9jv8pxero.mysql.rds.aliyuncs.com

DestinationEndpointPort

integer

No

The port that is used to connect to the destination database.

Note

This parameter is required when DestinationEndpointInstanceType is set to Express, Agent, Other, or ECS.

3306

DestinationEndpointDatabaseName

string

No

The name of the destination database.

Note

This parameter is required if the database engine is PostgreSQL or MongoDB.

test

DestinationEndpointUserName

string

No

The username for the destination database account.

Note

This parameter is optional if the database engine is Redis, or if DestinationEndpointInstanceType is set to Agent and the database engine is MSSQL. In other scenarios, this parameter is required.

test

DestinationEndpointPassword

string

No

The password for the destination database account.

Note

This parameter is optional if the database engine is Redis, or if DestinationEndpointInstanceType is set to Agent and the database engine is MSSQL. In other scenarios, this parameter is required.

Test

BackupGatewayId

integer

No

The ID of the backup gateway.

Note

This parameter is required when DestinationEndpointInstanceType is set to Agent.

4312****

RestoreObjects

string

No

The objects to restore.

  • This parameter is optional if DestinationEndpointInstanceType is set to Agent. In other scenarios, this parameter is required.

  • The value must be a JSON string in the following format: [{ "DBName": "source_database_name", "NewDBName": "destination_database_name" }]

Note

You can use this API operation to restore data only at the database level. To restore data at the table level, log on to the console. For more information, see Restore databases.

MySQL表级别恢复示例如下: [{\"DBName\":\"dbname\", \"NewDBName\":\"dbname1\"}]

RestoreTime

integer

No

The point-in-time for the restore, specified as a UNIX timestamp in milliseconds.

1554560477000

BackupSetId

string

No

The ID of the full backup set to use for the restore. The BackupSetId and RestoreTime parameters are mutually exclusive.

dbs1hvb0w*****

RestoreTaskName

string

Yes

The name of the restore job.

test

DestinationEndpointOracleSID

string

No

The SID of the Oracle database.

Note

This parameter is required if the database engine is Oracle.

test

RestoreDir

string

No

The restore directory. This parameter is required if DestinationEndpointInstanceType is set to Agent and the database type is MySQL.

test

RestoreHome

string

No

The installation directory of the database.

test

DuplicateConflict

string

No

The policy for resolving same-name object conflicts. Valid value:

renamenew: Renames the restored object if its name conflicts with an existing object.

renamenew

CrossAliyunId

string

No

The ID of the Alibaba Cloud account that owns the source database. This parameter is required for cross-account restores.

2749528728********

CrossRoleName

string

No

The name of the RAM role used for the cross-account restore.

test123

ClientToken

string

No

A client-generated token to ensure request idempotence. This token must be unique across requests.

ETnLKlblzczshOTUbOC********

RestoreDestinationMode

string

No

The type of the restore destination. Valid values:

  • EXIST_INSTANCE: Restores data to an existing instance.

  • NEW_INSTANCE: Restores data to a new instance.

EXIST_INSTANCE

EnableDestinationEndpointSsl

boolean

No

Specifies whether to enable SSL encryption to connect to the destination database.

true

SslCaPem

string

No

The SSL certificate used to connect to the destination database.

Note This parameter is required when EnableDestinationEndpointSsl is set to true.

-----BEGIN CERTIFICATE----- ... -----END CERTIFICATE-----

DestDatabaseInstanceType

string

No

The type of the new instance to create for the restore.

Note This parameter is required when RestoreDestinationMode is set to NEW_INSTANCE.

rds

DestDatabaseInstanceRegion

string

No

The region where the new instance will be created.

Note This parameter is required when RestoreDestinationMode is set to NEW_INSTANCE.

cn-beijing

DestDatabaseInstanceVpc

string

No

The VPC ID of the new instance.

Note This parameter is required when RestoreDestinationMode is set to NEW_INSTANCE.

vpc-xx

DestDatabaseInstanceClass

string

No

The instance type of the new instance.

Note This parameter is required when RestoreDestinationMode is set to NEW_INSTANCE.

mysql.x4.large.2

DestDatabaseInstanceStorageSize

string

No

The storage space of the new instance. Unit: GB.

Note This parameter is required when RestoreDestinationMode is set to NEW_INSTANCE.

500

DestDatabaseInstanceVSwitch

string

No

The vSwitch ID of the new instance.

Note This parameter is required when RestoreDestinationMode is set to NEW_INSTANCE.

vsw-xx

DestDatabaseInstanceDatabaseVersion

string

No

The database engine version of the new instance.

Note This parameter is required when RestoreDestinationMode is set to NEW_INSTANCE.

8.0

AutoOpenDatabase

string

No

Specifies whether to automatically start the Oracle instance after restoring a physical backup. Valid values: true and false.

true

AutoShutdownDatabase

string

No

Specifies whether to automatically stop the Oracle instance before restoring a physical backup. Valid values: true and false.

true

Response elements

Element

Type

Description

Example

object

The response object.

HttpStatusCode

integer

The HTTP status code returned for the request.

200

RequestId

string

The ID of the request.

60AF7C5D-EF4D-4D48-8FD5-C0823FDF28AC

ErrCode

string

The error code returned if the request fails.

Param.NotFound

Success

boolean

Indicates whether the request was successful.

true

ErrMessage

string

The error message returned if the request fails.

The specified parameter %s value is not valid.

RestoreTaskId

string

The ID of the restore task.

s102h*****

Examples

Success response

JSON format

{
  "HttpStatusCode": 200,
  "RequestId": "60AF7C5D-EF4D-4D48-8FD5-C0823FDF28AC",
  "ErrCode": "Param.NotFound",
  "Success": true,
  "ErrMessage": "The specified parameter %s value is not valid.  ",
  "RestoreTaskId": "s102h*****"
}

Error codes

HTTP status code

Error code

Error message

Description

403 Request.Forbidden Have no Permissions

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.