Skip to content

Restore a database from a snapshot

View as Markdown

To get data back from a backup, restore a snapshot. The restore creates a new database that holds the data from that snapshot. The database the snapshot came from stays as it is. You can compare the two, copy back what you need, or switch your applications over to the new one.

The source database can be in any state, including Stopped.

  1. On the source database’s details page, open the Snapshots tab.
  2. Open the snapshot’s row menu and choose Restore.
  3. In Restore Snapshot, enter a Database Name for the new database. The suggestion is the source database’s name followed by -restore. The name follows the same rule as any database name. It has 3 to 50 characters of lowercase letters, numbers and hyphens, starts with a letter, and ends with a letter or number. It must be unique in the project.
  4. Select Restore.

TIR starts the restore and opens the new database’s details page. The new database shows Creating until it is ready, like any new database, and then Running.

The restored database has:

  • The data, databases and users that were in the snapshot.
  • The source database’s plan, PostgreSQL version, region and storage size, as they are when the restore starts.
  • The source database’s admin password, as it is when the restore starts.

A restored database is a separate database with its own price. See pricing.

These settings stay with the source database:

  • The IP allowlist starts empty, so the public endpoint opens only once you add an IP range.
  • The VPC, the parameter group, and the snapshot schedule start unset.

Once the new database is Running, set them up:

  1. Add the IP ranges your applications connect from, and attach a VPC if they connect privately. Edit Database saves an update only when the allowlist has at least one range, so add a range even if you plan to connect only through the VPC. See Control network access to a database.
  2. (Optional) Attach a parameter group. See Use parameter groups.
  3. (Optional) Set a snapshot schedule. See Schedule snapshots of a database.

The restore is recorded on Activity Timeline of both databases. The source database shows “Snapshot restored”, with the snapshot and the new database’s name. The new database shows “Database created (restored from snapshot)”, with the source and the snapshot.

When the new database is Running and has an IP range, connect to it and check your data. See Connect to a database. When you have finished with the source database, you can delete it, but its snapshots go with it. See Delete a database.