Help Center/ GaussDB/ API Reference/ APIs (Recommended)/ Backup and Restoration/ Restoring Data to the Original or Existing Instance
Updated on 2026-07-16 GMT+08:00

Restoring Data to the Original or Existing Instance

Function

This API is used to restore data to the original DB instance or an existing DB instance. Before calling this API:

Debugging

You can debug this API in API Explorer.

URI

POST /v3/{project_id}/instances/recovery

Table 1 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID of a tenant in a region.

To obtain the value, see Obtaining a Project ID.

Constraints

N/A

Range

The value can contain 32 characters. Only letters and digits are allowed.

Default Value

N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token.

You can obtain the token by calling the IAM API used to obtain a user token.

After a response is returned, the value of X-Subject-Token in the response header is the token.

Constraints

N/A

Range

N/A

Default Value

N/A

X-Language

No

String

Definition

Language.

Constraints

N/A

Range

  • zh-cn: Chinese
  • en-us: English

Default Value

en-us

Table 3 Parameter description

Parameter

Mandatory

Type

Description

source

Yes

Object

Definition

Instance from which the backup was created. For details, see Table 4.

Constraints

N/A

target

Yes

Object

Definition

The instance to which the backup is restored. For details, see Table 5.

Constraints

N/A

Table 4 source field data structure description

Parameter

Mandatory

Type

Description

instance_id

Yes

String

Definition

ID of an instance that a backup is created for, which uniquely identifies the instance. You can obtain the ID by calling Querying Backups.

Constraints

N/A

Range

The value can contain 36 characters. Only letters and digits are allowed.

Default Value

N/A

type

Yes

String

Definition

Restoration mode.

Constraints

N/A

Range

  • backup: Data is restored using backups. In this case, backup_id is mandatory.
  • timestamp: Data is restored using point-in-time recovery. In this case, restore_time is mandatory.

Default Value

backup

backup_id

No

String

Definition

ID of the backup used for restoration. It indicates the ID of the full backup corresponding to schema_type. You can obtain the ID by calling Querying Backups. This parameter must be specified when a backup is used for restoration.

Constraints

N/A

Range

N/A

Default Value

N/A

restore_time

No

String

Definition

Timestamp to which data is restored to using point-in-time recovery. You can query the available time range by calling the Querying the Restoration Time Range API.

Constraints

N/A

Range

The value is a 10-character string in the yyyy-mm-dd format, consisting only of digits and hyphens (-).

Default Value

N/A

Table 5 target field data structure description

Parameter

Mandatory

Type

Description

instance_id

Yes

String

Definition

ID of the target instance that data will be restored to. You can obtain the ID by calling Querying Backups.

  • When restoring data to the original instance, enter the original instance ID.
  • When restoring data to an existing DB instance, enter the existing instance ID.

Constraints

N/A

Range

N/A

Default Value

N/A

Response Parameters

Table 6 Response body parameters

Parameter

Type

Description

job_id

String

Definition

Job ID.

Range

N/A

Example Request

Restoring data to the original or existing instance

POST https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/opengauss/v3/0483b6b16e954cb88930a360d2c4e663/instances/recovery
{ 
   "source" : { 
     "instance_id" : "5362449138da4e408dbae5152ca26640in14", 
     "type" : "backup", 
     "backup_id" : "cc94568cb5a54e4a8ab5dff95e64a5e0br14"
   }, 
   "target" : { 
     "instance_id" : "5362449138da4e408dbae5152ca26640in14" 
   } 
 }

Example Response

Data restored to the original or existing instance.

{ 
  "job_id" : "a03b1b8a-b756-467c-8a49-38720c3d23ec" 
}

Status Codes

Error Codes

For details, see Error Codes.