Skip to content

Download a backup's files or database

GET /v1/sites/{siteId}/backups/{backupId}/download

Sends one part of a completed backup as a file: part=files, the site's files (a .tar.gz archive), or part=database, its database (a gzipped SQL dump). The file comes from the API whichever storage the backup is in, sent as it's read; its name is in Content-Disposition. Every download is written to the token's request log.

Limits. Only a backup with canDownload: one on an SFTP server is downloaded from that server, and one in Google Drive from its folder there (409 conflict, with the folder's link). Also 409 conflict: the storage refuses the file or no longer has it, or it has no IPv4 address (the API downloads only over IPv4). 60 downloads an hour per account, and 50 GB a day: once an account has downloaded that much today, a download answers 429 rate_limited until the day ends at 00:00 UTC (one that starts under it finishes).

Scopes

The token needs this scope. Without it, the request is refused with insufficient_scope (see Scopes).

sites:files
Files and logins. File Manager, WordPress logins, cron jobs, backup downloads and backup storage. Full access to the sites' code and data.

Path parameters

FieldType and description
siteId Required

string

The site's id.

backupId Required

string

The backup's id, from the site's backups.

Query parameters

FieldType and description
part Required

string

The part to download: files (a .tar.gz archive) or database (a gzipped SQL dump).

One of: filesdatabase

Example request

curl "https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backups/5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f/download?part=database" \
  -H "Authorization: Bearer $RABBITFLARE_TOKEN" \
  -OJ

Response

200 OK The answer is the file itself, as application/gzip, without the data envelope.

Example response

200 OK

The file itself, as application/gzip, without the data envelope.

Errors

The errors this request can answer besides those every request can (a missing token, a missing scope, the rate limits). Each answer is an Error object (see Errors).

Status and codeWhen, and what to do
400 invalid_parameter

A query parameter is unknown or has a wrong value (fields names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.

Correct or remove the parameter named in fields.

403 feature_unavailable

This product isn't open to the account.

Contact support if you'd like it opened.

404 not_found

The resource doesn't exist, or isn't this account's.

Check the id. Ids of other accounts' resources answer the same way.

409 conflict

This clashes with something that exists, or is already done (for example, a domain already connected to a site).

Read message; there may be nothing left to do.

409 server_restoring

The server is being restored, and nothing else can change it or its sites until that's done.

Wait until the restore finishes (the server's pendingAction is null again), then try again. A restore that stopped partway keeps pendingAction: "restore", with the server's lastError set, until our team has checked the server.

429 rate_limited

Too many requests. scope says which limit: token, account, create, operation or network.

Wait for Retry-After seconds, then go on more slowly.

502 bad_gateway

Something on our side didn't answer properly.

Try again in a moment.

Rate limit

Heavy requests: 20 a minute per token, 40 per account. More in Rate limits.

Added on .

Popular

API docs