Restore from file
Backups
Restore from file
Upload a pg_dump file and restore it into a database.
POST
Restore from file
Uploads a
Maximum file size: 512 MB.
pg_dump file and restores it into the target database. Use this when migrating from another host or restoring from a locally stored backup.
Path parameters
| Parameter | Type | Description |
|---|---|---|
id | uuid | Database ID |
Request body
multipart/form-data with a single file field.
Supported file formats
| Extension | Description |
|---|---|
.sql.gz | Compressed SQL dump (what DBHost produces) |
.sql | Plain SQL text dump |
.dump | pg_dump custom format (pg_dump --format=custom) |
.backup | pg_dump custom format (alternate extension) |
Example
Response
200 OK
Errors
| Status | Code | Description |
|---|---|---|
| 400 | INVALID_REQUEST | Request is not multipart/form-data |
| 400 | MISSING_FILE | No file field in form data |
| 400 | INVALID_FILENAME | Filename doesn’t match a supported format |
| 401 | UNAUTHORIZED | Missing or invalid API key |
| 404 | DATABASE_NOT_FOUND | Database doesn’t exist, isn’t owned by this user, or isn’t in scope for this key |
| 413 | PAYLOAD_TOO_LARGE | File exceeds the 512 MB size limit |
| 503 | AGENT_ROUTE_UNAVAILABLE | The VPS agent doesn’t support restore yet (needs update) |
| 500 | AGENT_ERROR | The VPS agent failed to restore from the uploaded file |