Created
July 21, 2017 18:38
-
-
Save joaomarceloods/02f821027e0007039eda27ced6565919 to your computer and use it in GitHub Desktop.
Postgres - Clone remote database
This file contains 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
pg_dump -Fc \ | |
-d REMOTE_DB_NAME \ | |
-h REMOTE_DB_HOST \ | |
-p 5432 \ | |
-U REMOTE_DB_USER \ | |
|\ | |
pg_restore \ | |
-d LOCAL_DB_NAME \ | |
-h localhost \ | |
-p 5432 \ | |
-U LOCAL_DB_USER \ | |
-n public --clean --no-owner \ | |
--role=LOCAL_DB_USER |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment