You can call this operation to restore data to the current MongoDB instance.

This operation is only applicable to replica set instances. RestoreDBInstance cannot be performed on standalone instances or sharded cluster instances. You can use the following methods to clone a standalone instance: Create an instance based on a backup. Call CreateShardingDBInstance to clone a sharded cluster instance.

Note This operation overwrites the data of the current instance, and the data cannot be recovered. Exercise caution when performing this operation.

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 RestoreDBInstance

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

BackupId Integer Yes 11111111

The ID of the backup.

Note Call DescribeBackups to query the backup ID.
DBInstanceId String Yes dds-bpxxxxxxxx

The ID of the instance.

Response parameters

Prameter Type Sample response Description
RequestId String 973DCB8F-56B3-4102-8777-3A90495927F7

The ID of the request.

Examples

Sample requests

http(s)://mongodb.aliyuncs.com/? Action=RestoreDBInstance
&BackupId=11111111
&DBInstanceId=dds-bpxxxxxxxx
&<Common request parameter>

Sample success response

XML format

<RestoreDBInstanceResponse>
      <RequestId>973DCB8F-56B3-4102-8777-3A90495927F7</RequestId>
</RestoreDBInstanceResponse>

JSON format

{
    "RequestId": "973DCB8F-56B3-4102-8777-3A90495927F7"
}

Error codes

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