Skip to content

Latest commit

 

History

History
45 lines (27 loc) · 1.18 KB

MAINTENANCE.md

File metadata and controls

45 lines (27 loc) · 1.18 KB

Maintenance

Postgres

The pg_dump and pg_restore tools are used to backup and restore the Postgres DB. You can install these tools with Homebrew on macOS without needing to install Postgres itself:

brew install libpq

Backing up remotely

See the Postgres Tools readme for instructions on how to run a one-off Fly machine that will perform a Postgres backup and upload it to Backblaze B2.

Backing up locally

If you don't want to use a Fly machine to perform a remote backup, you can perform one locally.

Create a Postgres backup:

scripts/pg-backup.sh

You'll be prompted for the Postgres password.

This script uses pg_dump to produce a timestamped, compressed Postgres DB dump and upload it to Backblaze B2 for safekeeping.

More information on pg_dump:

Restoring

To communicate with Postgres, first open a local proxy:

fly proxy 5432 --app pie-gd-postgres15

Restore a Postgres backup:

pg_restore --username=postgres --dbname=pie_gd_mastodon <filename>