POST/databases/{uuid}/imports

Import a database backup

Submits a backup restore operation for the specified database. Choose upload, s3, or server as the import source and provide the fields required for that source. The import is queued asynchronously; use the database import status endpoint to monitor its progress.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 7 body fields
uuidstringrequired
The UUID of the database to restore the backup into.

Backup restore options. Select a source and provide its required fields: upload requires upload_id, s3 requires s3_storage_uuid and path, and server requires path.

dump_allbooleanoptional
Default:false
keep_ownersbooleanoptional
Restore object owners and privileges from a single-database PostgreSQL archive. By default they are skipped, because the roles of another server usually do not exist.
Default:false
replace_existingbooleanoptional
Drop matching PostgreSQL objects before restoring a single-database archive.
Default:false
restore_mysql_usersbooleanoptional
MySQL and MariaDB backups containing all databases: also restore the mysql system database (users, passwords, and privileges). By default the system databases are skipped, so the database keeps its own users and passwords.
Default:false
sourcestringrequired
Allowed:upload
sqlite_databasestringoptional
SQLite: the database file to restore into. Must be one of the database files. Defaults to the file named in the backup file name, else the first file.
upload_idstringrequired

4 status codes
202Returns confirmation that the database import was queued.
403Returned when the token does not have the deploy ability required to import a backup.
409Returned when a start, restart, or import of the database is already in progress.
422Returned when the request fails validation, such as when a source or one of its required fields is missing or invalid.
errorsobjectoptional
messagestringoptional

Error handling

A 403 is returned when the token does not have the deploy ability. A 409 is returned when a start, restart, or import is already in progress for the database. A 422 is returned when the request fails validation; the uuid path parameter must identify the database, and source must be upload, s3, or server with the corresponding required fields: upload requires upload_id in UUID format, s3 requires s3_storage_uuid and path, and server requires path.