Managed Databases

Restore database

Changed on

Restore a database to a backup or a point in time, either into a new database (clone_to_new: true) or over this one (in_place: true).

<Note> Before restoring, get a **backup ID** or the **restore window** from [List backups](/api-reference/databases/list-database-backups). </Note>

Choose the restore point with backup_id (a completed backup with restorable: true) or, for PostgreSQL and MySQL on paid plans, pitr_timestamp (any time from restore_window_start on the backup list until now). Omit both to restore the latest available state. A point outside the window returns 400. Set exactly one of clone_to_new and in_place.

  • New database: inherits the source's plan, storage, VPC, and project, starts with no read replicas, and bills pay-as-you-go. High availability is an explicit choice via ha_enabled, never inherited. If new_name is taken, the platform adds a suffix (-2, -3, …). Poll GET /api/v1/databases/{new_database_id} like any create. Free databases cannot restore into a new database.
  • In place: overwrites this database. A safety backup is taken first, the status is restoring while it runs, and new_database_id is empty. Data written after the restore point is lost.
post/api/v1/databases/{database_id}/restore

Request

  • Base URL
    https://api.rafftechnologies.com
  • URL
    https://api.rafftechnologies.com/api/v1/databases/{database_id}/restore
  • Auth
    API key in header X-API-Key

Path parameters

database_idstring required

Database ID (UUID) or short id (the database_id field, e.g. a1b2c3d4)

Request body

clone_to_newboolean

Restore into a new database

in_placeboolean

Restore over this database. Data written after the restore point is lost.

backup_idstring uuid

Restore from this completed backup. Omit to use pitr_timestamp or the latest state.

pitr_timestampstring date-time

Point-in-time restore target (RFC 3339). PostgreSQL only — Valkey restores from snapshots via backup_id.

new_namestring

Name for the new database. Defaults to {source-name}-restored; auto-suffixed (-2, -3, …) if taken.

ha_enabledboolean

Enable high availability on the new database (+70% of the plan price for PostgreSQL, Valkey and ClickHouse, +140% for MySQL and Kafka). Never inherited from the source.

Response

Restore started

successboolean
new_database_idstring

Short ID of the new database being created (empty for an in-place restore)

Changes