Managed Postgres - backup/restore via flyctl

You have been able to backup/restore Managed Postgres (MPG) clusters via the dashboard. But now it is possible to interact with backup/restore via flyctl.

Listing existing backups for a cluster -

flyctl mpg backups list $CLUSTER_ID
ID                                      START                   STATUS          TYPE
backup_1761291386_b5fb3b8edbf4fa4a      2025-10-24T07:36:31Z    completed       incr
backup_1761288358_9b9865f5156f70b9      2025-10-24T06:46:02Z    completed       incr
backup_1761284523_3f399aa7d1c835a3      2025-10-24T05:42:08Z    completed       incr
backup_1761280180_a08144d3e1232419      2025-10-24T04:29:44Z    completed       incr
backup_1761276657_b0fa9d41d64e28cf      2025-10-24T03:31:02Z    completed       incr
backup_1761272924_e7c0c9626a96ee19      2025-10-24T02:28:48Z    completed       incr
backup_1761269455_1f58b7b768e6cb8d      2025-10-24T01:31:00Z    completed       full

Creating a new backup (note this queues the backup to run asynchronously) -

flyctl mpg backups create $CLUSTER_ID --type full
Creating full backup for cluster <CLUSTER_ID>...
Backup queued successfully!
  ID: backup_1761293409_f576f9329fa19106

Restoring a backup into a new cluster -

flyctl mpg restore $CLUSTER_ID --backup-id backup_1761293409_f576f9329fa19106
Restoring cluster <CLUSTER_ID> from backup backup_1761293409_f576f9329fa19106...
Restore initiated successfully!
  Cluster ID: <RESTORED_CLUSTER_ID>
  Cluster Name: <RESTORED_CLUSTER>

To be clear none of this is new functionality, but having access to this from the command line will make these backup/restore interactions more convenient for certain workflows. And should unlock things that were not really possible before.

5 Likes