Backups & restore
Managed databases are backed up on a schedule you control. A restore goes into the same database, and a safety backup is taken first.
Automated backups
Every paid database is backed up every hour and every day, and those two cannot be switched off. Its backups are kept for at least 7 days. Raising retention also keeps the backups you already have for longer. Lowering it applies to new backups only. A database at the Free size has no automatic backups until you switch them on.
Open the database's Settings tab and find Backups. There you can:
- switch Weekly backups on or off, and on the Free size, Hourly and Daily too,
- pick the time of day they run, in UTC. The default is 02:00, and weekly backups run on Sunday,
- set retention: 7 to 365 days for a paid database, or 1 to 7 days at the Free size. The default is 7. Hourly backups are kept for 7 days at most, so a longer retention applies to your daily, weekly and manual backups,
- choose the backup region,
- take one straight away with Back up now, before a risky change.
With hourly backups on, your recovery points are at most an hour apart.
Paid Postgres databases can also be restored to any minute of the last 7 days, into a new database. See Point-in-time recovery.
Each backup is listed with its status (Pending, Running, Completed or Failed), its size, what triggered it (Daily, Weekly, Manual or Before restore) and when it expires. A failed backup says why in plain words.
On the Free size, switch backups on for anything holding real data. The one database where going without is reasonable is one you can recreate from a seed script.
Downloading a backup
Any completed backup can be downloaded from the download button on its row, so you can keep your own copy outside Naijacloud. The link is short-lived; open the list again for a fresh one.
Caches (Redis and Valkey) are not backed up.
Restoring
Pick a completed backup and choose Restore. The restore goes into the same database and replaces its current data with the backup's.
Anything written after the backup was taken is not in it. Before restoring production, note what has changed since, whether that is orders, sign-ups or uploads. That is what you are choosing to lose.
Before the restore starts we take one more backup, labelled Before restore, so you can go back to where you were if you picked the wrong point.
What backups do not cover
Backups protect the database. They do not include:
- object storage buckets (see Object storage),
- environment variables or secret files,
- your source code, which lives in Git.
A full recovery rehearsal should cover all four, not just the database.
Backups and previews
A preview deploy gets a forked copy of the database taken when the preview is created. That fork is a convenience for review, not a backup: it is discarded when the pull request closes.
Related: Activity log.