Restore one database
\c myappSELECT pgbx.restore(into_db => 'myapp_restored'); -- newest backupSELECT pgbx.restore(into_db => 'myapp_restored', at => '2026-10-01 09:00'); -- newest at or beforeSELECT state, error FROM pgbx.history WHERE id = 43;restore() returns a job id. It restores the newest per-database backup taken at or before at
into a new database. Restore streams S3 straight into pg_restore; a download resumes from the byte it reached.
pgbx db-restore --db myapp --into myapp_restored --waitpgbx db-restore --db myapp --into myapp_restored --time '2026-10-01 09:00+00' --waitdb-restore refuses an existing database or the source database. --time must carry a UTC offset.
Swap when verified
Section titled “Swap when verified”Swapping is up to you and is destructive:
-- after checking myapp_restored, with no connections to eitherALTER DATABASE myapp RENAME TO myapp_old;ALTER DATABASE myapp_restored RENAME TO myapp;A restore is only as fine-grained as your schedule: back up more often where that matters.
Server gone? Restore from S3 onto a new one with pgbx db-restore --from-s3.