Exporting your data
Request a complete export of every database on a service, download it for 7 days, and restore it anywhere with pg_restore.
Your data is yours, and you can take all of it with you at any time. There are two ways: run
pg_dump yourself against your service, as Dump and restore
describes, or ask Balta for an export, which this page describes.
What an export contains
An export is a complete copy of every database on the service, postgres included, with one file
for each database. Nothing is left out and nothing can be selected: owners and privileges come with
the data. Balta takes the dump on the host itself, as the database superuser, so it includes objects
your own role cannot read.
Each file is a standard PostgreSQL custom-format dump (pg_dump --format=custom), compressed with
that format's default compression. Files are named <service>-<database>-<YYYYMMDD>.dump, with the
date the export finished, in UTC. Each export lists every file's size and SHA-256, and the
PostgreSQL major version it was taken from.
Requesting an export
Open Import and export in the dashboard, choose the service, and press Request an export.
You can also request one through the API with POST /services/{id}/export.
You can leave the page. When the export is ready, we email the person who requested it. The email links to the export in the dashboard, not to a file.
Producing an export does not stop, restart or reconfigure a running service. It is an operation on the service, like an upgrade or a restore, and a service runs one operation at a time: an export is refused while another operation is running, and other operations are refused until the export finishes. A second export of the same service is refused, not queued. Downloading is not an operation, and works at any time.
Downloading it
A ready export has a Download button for each database. Every press issues a new download link
for that file. A link works for 24 hours, or until the export's 7 days end if that is sooner, and it
can be used any number of times in that period, including from curl. Anyone who has the link can
use it, so treat it like a password.
Every download is checked again at the moment it starts. The person the link was issued to must still be a member of the organisation, still be allowed to export, and be connecting from an address your organisation's network rules allow.
The file is decrypted as it streams to you. Its SHA-256 is checked before the last part is sent, so a file that does not match stops short instead of arriving complete and wrong. A download that stalls for 2 minutes is cut off, and an interrupted download starts again from the beginning.
Check what you downloaded
Compare the file's checksum with the SHA-256 listed in the dashboard:
shasum -a 256 <file>.dumpOn Linux, sha256sum <file>.dump does the same.
Restoring it
Use pg_restore from a PostgreSQL version at least as new as the one the export was taken from:
pg_restore --dbname="<connection string>" --no-owner --no-privileges --jobs=4 --verbose <file>.dumpThe archive carries the original owners and privileges. --no-owner --no-privileges restores
everything as the role you connect with, which is usually what you want on a new server. Leave them
out to keep the originals, if the same roles exist where you restore. --jobs sets how many parts
are restored in parallel.
How long an export is kept
An export can be downloaded for 7 days after it is ready. When the 7 days end, within 15 minutes, we destroy the export's encryption key. From then on nobody, Balta included, can read its files. Our storage then deletes the files themselves: each is due for deletion 8 days after it was written.
When an export fails, its key is destroyed at once, and anything it stored is deleted the same way.
How it is stored
Each export is encrypted with AES-256-GCM, under a key of its own, and kept in a storage bucket used only for exports, in Hetzner's Falkenstein data centre in Germany, apart from your backups. The hosts that run databases can write exports but cannot read them. The service that sends you your downloads can read them but cannot change or delete them.
Exports and your account
You can request and download an export in every account state until your organisation's data has been deleted: during a trial, while active, after a failed payment, in the grace period, while suspended, after cancelling, and while deletion is pending. A suspended service is stopped; an export starts it for the dump and stops it again afterwards.
If you delete a service after exporting it, its export stays downloadable for the rest of its 7
days. The dashboard lists live services only, so download it through the API with
POST /exports/{id}/download-links. A deleted service cannot be exported again, because there is
nothing left to export.
Limits
- Size. Balta sets no size limit. One database's compressed file can be up to about 1.8 TB; a larger one fails.
- Time. An export is allowed 2½ hours plus 2 minutes for each GiB of the service's storage, up to 48 hours. An export that takes longer fails, and nothing about your service is changed.
- How often. One export of a service at a time. There is no limit on downloads.
Export statuses
| Status | What it means |
|---|---|
| Queued | Requested, and waiting to start. |
| Running | The export is being produced. It ends as Ready or Failed. |
| Ready | The files can be downloaded. |
| Expired | The 7 days are over and the encryption key is destroyed. Nobody can read the files. |
| Deleted | Our storage confirmed the files are gone, at the time shown. |
| Failed | The export did not complete. Nothing about your service was changed; request another. |
The audit log
Every step of an export is recorded in your organisation's audit log:
- the request, as Accepted, and then Succeeded or Failed when the export ends; a refused request is recorded as Denied;
- every download link issued, with the database and the link's expiry;
- every download, before the first byte is sent, with the person, the database, the size, the address and the client;
- a download refused because the person no longer qualifies;
- the destruction of the export's key, and the confirmation that its files are gone, both recorded by Balta.
A link past its 24 hours, an export past its 7 days, or an unknown link is refused without a row.