Skip to content

Instantly share code, notes, and snippets.

@alirezas
Created August 11, 2019 12:11
Show Gist options
  • Save alirezas/1d563f1c887fd2c1ebe4312c5e86bda6 to your computer and use it in GitHub Desktop.
Save alirezas/1d563f1c887fd2c1ebe4312c5e86bda6 to your computer and use it in GitHub Desktop.
# backup all postgres databases in a gz file
pg_dumpall -U postgres -p 5432 --quote-all-identifiers | gzip >postgresapp.sql.gz
# restore backup file
gunzip <postgresapp.sql.gz | psql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment