Backup, Restores, & Snapshots

This document applies to Postgres clusters running on our next-gen Apps V2 architecture (Fly Machines). If you created your cluster using any flyctl version before v0.0.412, refer to Fly Postgres on Apps V1 and Multi-region PostgreSQL instead. performs daily storage-based snapshots of each of your provisioned volumes. These snapshots can be used to restore your dataset into a new Postgres application.

Listing Snapshots

Snapshots are volume specific, so you need to identify the volume whose snapshot you want to restore from. You can list your volumes by running the volumes list command with your Postgres app name.

fly volumes list -a <postgres-app-name>
vol_x915grn008vn70qy pg_data 10GB atl    b780ce3d    2 weeks ago
vol_ke628r677pvwmnpy pg_data 10GB atl    359d0e24    2 weeks ago

Once you have identified which volume to target, you can list its snapshots:

fly volumes snapshots list <volume-id>
ID                  SIZE   CREATED AT
vs_2AjJ4lGqQwDbRfxm 29 MiB 2 hours ago
vs_BAARBQxZKl6JKU04 27 MiB 1 day ago
vs_OPQXXna6kA2Qnhz8 26 MiB 2 days ago

Restoring From a Snapshot

To restore a Postgres application from a snapshot, simply specify the --snapshot-id argument when running the create command as shown below:

fly postgres create --snapshot-id <snapshot-id>