You need to enable JavaScript to run this app.
RDS for PostgreSQL

RDS for PostgreSQL

Copy page
Download PDF
Backup and recovery
RestoreToNewInstance
Copy page
Download PDF
RestoreToNewInstance
Call the RestoreToNewInstance API to restore data to a new instance.​
Request type​
Asynchronous request.​
Debug​
API Explorer
You can initiate calls online through API Explorer without paying attention to the signature generation process and quickly obtain the call results.
​
Request parameters​
​
Parameter​
Type​
Required?​
Example​
Description​
SrcInstanceId​
String​
Yes​
postgres-21a3333b****​
ID of the source instance to which the backup file belongs.​
BackupId​
String​
No​
20230801-170****​
Backup file ID of the source instance. Use the data saved in this backup file to create a new instance. You can query the backup file list information of the specified instance by calling DescribeBackups.​
tip​
At least one of BackupId or RestoreTime should be provided. If both BackupId and RestoreTime are provided, BackupId takes precedence.​
RestoreTime​
String​
No​
2022-01-01T10:10:10Z​
Any point in time within the retention period of the source instance log backup, formatted as yyyy-MM-ddTHH:mm:ssZ (UTC time). Call the DescribeRecoverableTime API to query the time range for data recovery from an instance backup.​
tip​
One of the two parameters, this parameter or BackupId, must be selected.​
NodeInfo​
Array of NodeInfoObject​
Yes​
Refer to the request example.​
Instance specification configuration. There is exactly one primary node and one secondary node, with 0 to 10 optional read-only nodes.​
StorageType​
String​
Yes​
LocalSSD​
Instance storage type. Fixed value LocalSSD (local SSD disk).​
StorageSpace​
Integer​
No​
100​
Instance storage space. Unit is GB, with a step size of 10 GB.​
tip​
Different specifications have different storage space value ranges. For detailed information on storage space value ranges, refer to Product specifications.​
VpcId​
String​
Yes​
vpc-2gdgzrrl5icjk50ztyz6b****​
Use this parameter to specify the virtual private cloud used by the instance.​
tip​
  • If you use ECS to connect to the PostgreSQL instance, the virtual private cloud must be the same as that of the ECS instance. Otherwise, the ECS instance cannot connect to the PostgreSQL instance through the private network.​
  • You can call the DescribeVpcs API to query available virtual private clouds.​
  • You can call the CreateVpc API to create a new virtual private cloud.​
SubnetId​
String​
Yes​
subnet-30uhx4w39n75s7r2qr0lq****​
Subnet ID.​
tip​
  • Only subnets in the availability zone where the instance is located can be selected.​
  • You can call the DescribeSubnets API to query all subnet information within the specified virtual private cloud and availability zone.​
  • You can call the CreateSubnet API to create a new subnet.​
InstanceName​
String​
No​
Name123​
Storage type. Rules:​
  • It cannot start with a digit or hyphen.​
  • It can only contain Chinese characters, letters, digits, underscores, and hyphens.​
  • The length must be between 1 and 128 characters.​
ProjectName​
String​
No​
Test​
Affiliated project. If this parameter is left empty, the new instance will be added to the default project by default.​
Tags​
Array of TagObject​
No​
Refer to the request example.​
Array of tag objects.​
tip​
Supports input of multiple sets of tag key-value objects at once. Up to 20 sets of tag key-value pairs can be input simultaneously per submission, and up to 50 tags can be bound to a single instance.​
ChargeInfo​
Object of ChargeInfoObject​
Yes​
{​
"ChargeType": "PostPaid"​
}​
Payment method.​
AllowListIds​
Array of String​
No​
[​
"acl-fdd6293f300143f2a4932bb483c8****",​
"acl-ded4c0b707e44efd8f0dbc4e88f5****"​
]​
Allowlist ID. To associate multiple allowlists, separate the allowlist IDs with a comma (,). An instance can associate up to 100 allowlists.​
MaintenanceWindow​
No​
Refer to the request example.​
Details of the instance maintenance window.​
​
NodeInfoObject​
​
Parameter​
Type​
Required?​
Example​
Description​
NodeId​
String​
No​
postgres-ca7b7019****​
Node ID. You can call the DescribeDBInstanceDetail API to query.​
tip​
Required when modifying node specification and deleting nodes (ModifyDBInstancesSpec).​
ZoneId​
String​
Yes​
cn-beijing-a​
The availability zone where the node is located. You can call the DescribeAvailabilityZones API to query it.​
tip​
  • Required when creating an instance (CreateDBInstance), restoring to a new instance (RestoreToNewInstance), and adding or modifying nodes (ModifyDBInstancesSpec).​
  • Primary, secondary, and read-only nodes can be deployed in different availability zones within the same region.​
NodeType​
String​
Yes​
Primary​
Node type, with values:​
  • Primary: Primary node.​
  • Secondary: indicates the secondary node.​
  • ReadOnly: Read-only node.​
NodeSpec​
String​
Yes​
rds.postgres.1c2g​
Node specification. Query specifications available for sale via DescribeDBInstanceSpecs API.​
NodeOperateType​
String​
No​
Create​
Operation type. Range:​
  • Create: add.​
  • Delete: delete.​
  • Modify: modify.​
tip​
  • In the CreateDBInstance and RestoreToNewInstance APIs, this field can only be set to Create.​
  • When modifying instance configuration, the specified NodeOperateType must be passed in for the involved nodes.​
​
TagObject​
​
Parameter​
Type​
Required?​
Example​
Description​
Key​
String​
Yes​
abc​
Tag key. Naming rules are as follows:​
  • It cannot start with any case-insensitive variation of the prefix volc:. volc: is a system-reserved tag key and is forbidden to use.​
  • It can only contain language characters, numbers, spaces, and English symbols (_, ., :, /, =, +, -, and @).​
  • The length must be between 1 and 128 characters.​
tip​
  • The number of tags created at one time cannot exceed 20.​
  • Tag keys cannot be duplicated under a single instance.​
Value​
String​
No​
3​
Tag value. The naming rules are as follows:​
  • It can only contain language characters, numbers, spaces, and English symbols (_, ., :, /, =, +, -, and @).​
  • Nullable. Length must be between 0 and 256 characters.​
​
ChargeInfoObject​
​
Parameter​
Type​
Required?​
Example​
Description​
ChargeType​
String​
Yes​
PostPaid​
Payment type. Values:​
  • PostPaid: pay-as-you-go.​
  • PrePaid: subscription (default).​
AutoRenew​
Boolean​
No​
true​
Is automatic renewal enabled for the prepaid scenario?​
  • yes: automatic renewal.​
  • false: no automatic renewal (default).​
PeriodUnit​
String​
No​
Month​
Purchase period for prepaid scenarios.​
  • Month: monthly (default).​
  • Year: subscription.​
Period​
Integer​
No​
1​
Subscription duration in a prepaid scenario. default value: 1.​
Number​
Integer​
No​
1​
Instance purchase quantity. Acceptable integer values range from 1 to 20, with a default of 1.​
tip​
When ChargeInfoObject is referenced by the RestoreToNewInstance API, Number can only be set to 1.​
​
MaintenanceWindowObject​
​
Parameter​
Type​
Required?​
Example​
Description​
DayKind​
String​
Yes​
Week​
The granularity of the maintenance cycle, with values of Week.​
DayOfWeekMaintenanceTime​
Array of DayOfWeekObject​
No​
Refer to the sample.​
Details of the instance maintenance window.​
​
DayOfWeekObject​
​
Parameter​
Type​
Required?​
Example​
Description​
DayOfWeek​
String​
Yes​
Monday,Tuesday​
Specify the maintainable day for the instance each week. Multiple selections allowed.​
  • Monday: Monday.​
  • Tuesday: Tuesday.​
  • Wednesday: Wednesday.​
  • Thursday: Thursday.​
  • Friday: Friday.​
  • Saturday: Saturday.​
  • Sunday: Sunday.​
tip​
If this value is not specified or empty, it defaults to all seven days of the week.​
MaintenanceWindowStartTime​
String​
Yes​
22:00Z​
The instance's start time within the maintenance window on the maintainable day. Format: HH:mmZ (UTC time).​
tip​
Currently, only start times between 16:00Z and 20:00Z are supported for the maintenance window.​
Period​
Integer​
Yes​
6​
Duration of the instance's maintenance window on a maintainable day.​
tip​
The duration is at least 2 hours and at most 6 hours.​
​
Response parameters​
​
Parameter​
Type​
Example​
Description​
InstanceId​
String​
postgres-21a3333b****​
Instance ID.​
OrderId​
String​
Order71220115095297****​
Order ID.​
​
Sample​
Sample request​
​
POST /?Action=RestoreToNewInstance&Version=2022-01-01 HTTP/1.1​
Content-Type: application/json​
Host: rds-postgresql.cn-beijing.volcengineapi.com​
X-Date: 20231002T101010Z​
Authorization: HMAC-SHA256 Credential=AKLTN2I0MmFiNzMxNWE5NDgzMzk4MmVjMTVkODlkZTZ****/20211202/cn-beijing/rds_postgresql/request,SignedHeaders=x-date, Signature=71d31fc7bcf990142851c9833c5656391486cda0ae2e0b8ada733b7c6458****​
{​
"SrcInstanceId": "postgres-ca7b7019****",​
"NodeInfo": [​
{​
"ZoneId": "cn-beijing-a",​
"NodeSpec": "rds.postgres.1c2g",​
"NodeType": "Primary",​
"NodeOperateType": "Create"​
},​
{​
"ZoneId": "cn-beijing-a",​
"NodeSpec": "rds.postgres.1c2g",​
"NodeType": "Secondary",​
"NodeOperateType": "Create"​
}​
],​
"BackupId": "20230801-170****",​
"StorageType": "LocalSSD",​
"StorageSpace": 20,​
"VpcId": "vpc-2gdgzrrl5icjk50ztyz6b****",​
"SubnetId": "subnet-30uhx4w39n75s7r2qr0lq****",​
"InstanceName": "测试实例",​
"ChargeInfo": {​
"ChargeType": "PostPaid",​
"Number": 1​
},​
"ProjectName": "default",​
"Tags": [​
{​
"Key": "Key",​
"Value": "Value"​
}​
],​
"MaintenanceWindow": {​
"DayKind": "Week",​
"DayOfWeekMaintenanceTime": [​
{​
"Period": 6,​
"DayOfWeek": "Monday,Tuesday",​
"MaintenanceWindowStartTime": "16:00Z"​
}​
]​
}​
}​
​
Sample response​
​
{​
"ResponseMetadata": {​
"RequestId": "20230801173634010212035227001977AC",​
"Action": "RestoreToNewInstance",​
"Version": "2022-01-01",​
"Service": "rds_postgresql",​
"Region": "cn-beijing"​
},​
"Result": {​
"InstanceId": "postgres-21a3333b****",​
"OrderId": "Order71220115095297****"​
}​
}​
​
Last updated: 2026.03.31 10:45:18