Backups, exports and restores
This page covers PostgreSQL databases. Everything on this page is on your database’s own page in the console and you can do all of it yourself. Read the restore section before you use it. A restore does not do what the word suggests, and it takes money from your wallet at the moment you ask for it rather than when it finishes.What you can do yourself
- Take a backup now.
Trigger backup, in theBackupssection. - See the backups you have.
View history, with the number of backups you have in brackets after it. It opens a sheet listing them under the columnsWhen,Status,Kind,Size,DurationandAction. - Restore one of them.
Restore, on the row of the backup you want. - Take an export now.
Export database, in theExportssection. - Download an export.
Download, on that export’s row once it is ready.
Trigger backup is for the
moment you want one before you do something risky, and it adds to the
scheduled ones rather than replacing them.
Two answers you can get instead of a backup starting:
What a restore actually does, and what it costs
A restore gives you a second database. It does not put your data back into the database you restored from.Restore opens a dialog titled Restore into a new database, and the dialog
says the same thing in its own words: This creates a new database from this backup. The source database stays untouched. You name the new database in
Name for the new database, and Confirm restore starts it.
Four things follow from that, and all four are worth reading before you click.
- The new database gets its own hostname, its own credentials and its own certificate. It is a different database, not a repaired copy of the old one.
- The database you restored from is untouched. It keeps running, keeps its connection string, and keeps its own backups.
- You are charged when you ask, not when it finishes. The monthly price of the plan your source database is on is taken from your wallet at the moment the restore is accepted. The dialog states the amount on its own line before you confirm.
- The new database then bills on its own cycle like any other database, so you are paying for two databases until you delete one of them.
Status reads as successful, or take a new backup and restore from
that one.
contact@pivocloud.com with the database’s name, and
the restore will work once it is linked.
contact@pivocloud.com.
Exports, and downloading one
An export is a compressed plain SQL dump of your database, produced when you ask for one and downloaded from the console. It is a file you keep. A backup lives on the platform and is what a restore reads; an export is yours to store wherever you like and to load into anything that speaks PostgreSQL.Export database starts one. The row underneath moves through four states
while it works: it is queued, then it is running, then it either finishes with
a Download button beside it or it does not finish and the row tells you why.
Only one export runs at a time for a database, and there is a wait between one
export and the next.
The file you get is named after the export’s own identifier with a .sql.gz
suffix, not after your database, so rename it if you are keeping several. The
console shows a SHA-256 checksum next to the export and the download carries
the same value in an X-Export-Sha256 response header, so you can prove the
file you have is the file the platform made:
How far back you can go
Two different things decide that, and reading them as one number is how people end up surprised. The plan your database is on decides whether you can go back to an arbitrary moment.Starterhas no point-in-time window at all. What Starter has is its backups, described below.Growthadvertises a window of 7 days.Businessadvertises a window of 14 days.
If the machine holding your database is lost
The window above protects you against something that went wrong inside a database that is otherwise healthy: a bad migration, a delete without a where clause, an application writing nonsense for an hour. That is the common case and the window is the right answer to it. It is not what protects you against losing the machine your database runs on. The copy taken off the platform every 24 hours is what protects you against that, and in that situation it is the only thing that survives. So your honest exposure to that second case is those 24 hours rather than the window your plan advertises. If you want it shorter than that for a particular moment, take your own export before you do anything risky and keep it somewhere else. That is the one lever you hold yourself.Restoring to a chosen moment
Growth and Business advertise a window you can be restored to any point
inside, and there is no control in the console for it today. To use it, email
contact@pivocloud.com with your database’s name and the exact moment you want
to go back to, and we will do the restore for you. Be as precise about the
moment as you can: the point of the window is that it is not limited to the
moments a backup happened to be taken.
The self-serve restore described above is a different thing. It restores a
backup, so it takes you to the moment that backup was taken, and it is
available on every plan.