Databases

Restore a checked backup into a new database of the same engine (default), or into this database after a safety backup (mode replace: owner/admin). PostgreSQL, MySQL and MariaDB. Needs databases:write, the exact database name and, from the dashboard, a sign-in within 5 minutes (403 details.reauthenticate). Runs as an import: follow the returned migration

post/databases/{databaseId}/backups/restore

Request

  • Base URL: https://hostingsurge.com/api/v1
  • URL: https://hostingsurge.com/api/v1/databases/{databaseId}/backups/restore
  • Auth: one of:
    • HTTP bearer
    • API key in cookie __Host-hs_session

Path parameters

databaseIdstring uuid required
Example:3f2b8a4e-5c1d-4e8f-9a7b-2c6d1e0f4a5b

Request body

executionIdstring required

id of a backup from GET /databases/{id}/backups/executions

mode'new' | 'replace'

new (default): restore into a new database of the same engine, the original stays untouched. replace: restore into this database itself: a safety backup is taken first and the restore only starts once it is stored; needs deployments:production (owner/admin)

namestring

mode new: name of the new database (default "<name>-restored-<date of the backup>")

projectIdstring uuid

mode new: attach the new database to this project (DATABASE_URL)

backupsboolean

mode new: give the new database the default daily backups

confirmstring required

the exact name of the database the backup belongs to. From the dashboard the sign-in must be at most 5 minutes old (403 with details.reauthenticate otherwise)

Response

Restore started

mode'new' | 'replace' required
databaseIdstring uuid required

mode new: the new database (provisioning until the restore is done); mode replace: this database

Changes

No recorded changes to this operation across all 1 revision of this API.