-
-
Save mkyung/c10dc86b4476b0c3cc54a7c2659cb81c to your computer and use it in GitHub Desktop.
Proper way to do backup (and restore!) with PostgreSQL π
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Backup your database with: | |
# This is Postgres custom format | |
pg_dump -Fc dbname > filename | |
# And recover it with: | |
# First create the DB with: | |
createdb -O owner_user dbname | |
# And then populate it: | |
pg_restore -d dbname filename |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment