Last active
November 26, 2017 08:02
-
-
Save eriknaslund/464eb34da222eaaeb29e66aac338cd8e to your computer and use it in GitHub Desktop.
PG dump and restore
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
| # Dump the database schema to the file schema.sql | |
| pg_dump -h $SRC_SERVER_IP -d $DB_NAME -U $DB_USER -f dump.sql -W -s -v | |
| # Restore the database schema into an empty database | |
| psql -h $DST_SERVER_IP -d $DB_NAME -U $DB_USER -f dump.sql -W |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment