Fly.io
Postgres Clusters

Restore Backup or Point in Time to New Cluster

View as Markdown

Restore a backup, or a point in time within the cluster's PITR recovery window, into a new Managed Postgres cluster. The source cluster is left unchanged, and a new cluster is provisioned asynchronously.

POST
/v1/postgres/{postgres_cluster_id}/restore

Restore a backup, or a point in time within the cluster's PITR recovery window, into a new Managed Postgres cluster. The source cluster is left unchanged, and a new cluster is provisioned asynchronously.

Authorization

bearerAuth
AuthorizationBearer <token>

A Fly.io access token. Create one with fly tokens create.

In: header

Path Parameters

postgres_cluster_id*string

Managed Postgres Cluster ID

Request Body

application/json

Restore details

backup_id?string

Backup label to restore from, as returned by the backups list. Mutually exclusive with pitr_time.

name?string

Name for the restored cluster. Defaults to a generated name derived from the source cluster and backup/point in time when omitted or blank.

pitr_time?string

Point in time to restore to, as an RFC3339 timestamp with an explicit offset from UTC (e.g. Z or +02:00). Normalized to UTC and must fall within the cluster's PITR recovery window. Mutually exclusive with backup_id.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/postgres/string/restore" \  -H "Content-Type: application/json" \  -d '{}'
{  "data": {    "attached_apps": [      {        "name": "string"      }    ],    "cpu_kind": "shared",    "cpus": 2,    "created_at": "string",    "disk_size_gb": 10,    "endpoints": {      "primary": {        "direct": {          "host": "string",          "port": 0        },        "pooler": {          "host": "string",          "port": 0        }      }    },    "id": "string",    "memory_mb": 1024,    "name": "string",    "organization": {      "name": "string",      "slug": "string"    },    "pg_major_version": "17",    "plan": "basic",    "postgis_enabled": true,    "region": "iad",    "replicas": 1,    "status": "ready"  }}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}