POST/services/{uuid}/databases/{database_uuid}/imports

Import a service database backup

Submits a backup restore operation for a service database using an uploaded file, an S3 object, or a server-side file. Select the source with source and provide the corresponding upload or storage details. The import runs asynchronously; poll the service database import status endpoint to check its progress.

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

2 parameters · 7 body fields
uuidstringrequired
The unique identifier of the service containing the database.
database_uuidstringrequired
The unique identifier of the service database to restore the backup into.

Database backup restore options. Choose a source and provide the fields required for that source.

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
202Confirms that the database import was queued.
403Returned when the token does not have the deploy ability.
409Returned when another start, restart, or import operation is already in progress for the database.
422Returned when the import request fails validation.
errorsobjectoptional
messagestringoptional

Error handling

A 403 is returned when the token lacks the deploy ability; a 409 when another start, restart, or import is in progress for the database; and a 422 when the request fails validation. The uuid path parameter and database_uuid path parameter must identify the service and database. In the body, source must be upload, s3, or server: upload requires upload_id, s3 requires s3_storage_uuid and path, and server requires path.