databases

Restore Database

Overwrite the database's current data with one of its backups, in place.

backup_id is a backup from GET /databases/{id}/backups that has completed. The database keeps its name, host, user and password, so connected applications only need to reconnect. Works for PostgreSQL and MySQL databases that are not part of a replication group.

The restore runs in the background and the database shows the status restoring meanwhile; it is unavailable for most of that time. It first takes a safety backup of the current data (type pre_restore); if that backup fails, nothing is overwritten and the database returns to running with the reason in error_message. On success the database returns to running; if the restore fails after the data was touched, it goes to error.

Responds 202 with the database (status restoring), 400 when the backup cannot be restored in place, 404 when the database or backup is not found, and 409 when the database is not running or already restoring.

post/api/v1/databases/{database_id}/restore

Request

  • Base URL: https://api.mengi.cloud (the document declares no server; this is the origin it was published from)
  • URL: https://api.mengi.cloud/api/v1/databases/{database_id}/restore
  • Auth: none declared

Path parameters

database_idstring uuid required

Request body

backup_idstring uuid required

Response

Successful Response

idstring uuid required
user_idstring uuid required
organization_idstring uuid nullable
cluster_idstring uuid required
namestring required
engine'postgresql' | 'mysql' required
engine_versionstring required
tier'single' | 'ha' | 'replicated' required
status'pending' | 'provisioning' | 'running' | 'degraded' | 'upgrading' | 'error' | 'deleting' | 'restoring' required
cpu_requestnumber nullable
memory_request_mbinteger nullable
storage_size_gbinteger required
replicasinteger required
database_namestring required
max_connectionsinteger nullable
extensionsstring[] nullable
external_accessboolean
external_hoststring nullable
connection_hoststring nullable
connection_portinteger nullable
connection_secret_namestring nullable
backup_enabledboolean required
backup_schedulestring nullable
backup_retention_daysinteger nullable
git_pathstring nullable
argocd_app_namestring nullable
replication_group_idstring uuid nullable
replication_rolestring nullable
replication_source_idstring uuid nullable
replication_hoststring nullable
replication_lag_bytesinteger nullable
replication_statusstring nullable
error_messagestring nullable
fee_exempt_untilstring date-time nullable
created_atstring date-time required
updated_atstring date-time required

Changes

No recorded changes to this operation across all 2 revisions of this API.