Skip to main content

Restore a PostgreSQL backup

Reviewed on

Restoration lets you recreate a PostgreSQL cluster from an existing backup or from the WAL (Write-Ahead Logging) archive of a source cluster.

Restoration never happens in place: it always creates a new cluster. The source cluster is not modified. If data is corrupted, restoring a recent backup is therefore the recommended recovery method.

To identify the backup to restore, see List the backups of a PostgreSQL cluster ↗.

Permissions​

info

This action requires the following IAM (Identity and Access Management) permissions:

  • postgresql.cluster.create

API​

The POST /postgresql/spaces/{spaceId}/clusters request restores a PostgreSQL cluster by creating a new cluster from a backup or from the WAL archive of a source cluster.

Parameters​

ParameterTypeRequiredDescription
spaceIdUUID (Universally Unique Identifier)YesIdentifier of the space

Request body​

{
"name": "my-restored-cluster",
"nodeConfiguration": {
"vcpuCount": 2,
"memorySizeGiB": 4
},
"volume": {
"type": "PERFORMANCE",
"sizeGiB": 20
},
"visibility": "INTERNAL",
"restoreConfiguration": {
"sourceType": "BACKUP",
"clusterId": "e592a4f6-2e49-46e7-b6d0-248a7711197a",
"backupId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
}

The name, nodeConfiguration, volume and visibility fields remain required and apply to the new cluster. They can differ from those of the source cluster.

Restore configuration​

The restore configuration is set through the restoreConfiguration field of the request body, which takes one of the two following modes.

Restore from a backup​

FieldTypeRequiredDescription
sourceTypestringYesRestore source type. Value: BACKUP
clusterIdUUIDYesIdentifier of the source cluster
backupIdUUIDYesIdentifier of the backup to restore

Restore from a cluster​

FieldTypeRequiredDescription
sourceTypestringYesRestore source type. Value: CLUSTER
clusterIdUUIDYesIdentifier of the source cluster
pointInTimedate-timeNoTimestamp of the point-in-time recovery (PITR, Point-In-Time Recovery). If omitted, the restoration is performed to the latest available state

Example of a restore with point-in-time recovery:

{
"restoreConfiguration": {
"sourceType": "CLUSTER",
"clusterId": "e592a4f6-2e49-46e7-b6d0-248a7711197a",
"pointInTime": "2026-09-30T14:30:00Z"
}
}

Restore behavior​

  • the restoration creates a new cluster; the source cluster is not modified;
  • the databaseName, user and extensions fields of the request body are ignored and replaced with the values from the source cluster;
  • the new cluster is created with the CREATING state, then moves to the RUNNING state once ready.

Response example​

{
"id": "550e8400-e29b-41d4-a716-446655440001",
"name": "my-restored-cluster",
"status": {
"state": "CREATING",
"message": "cluster is being created"
}
}

The response corresponds to the created cluster: its complete structure is identical to a cluster creation.

See the full specification