Last active
October 11, 2015 16:58
-
-
Save tobyhede/3890243 to your computer and use it in GitHub Desktop.
Dump and restore postgres to remote server
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
Pipe directly to remote server | |
pg_dump -C -U dbuser {DBNAME} | psql -h xxx.xxx.xxx.xx -U {DBUSER} >> restore.log | |
And with passwords as required | |
PGPASSWORD="{DBPASSWORD}" pg_dump -C -U dbuser {DBNAME} | PGPASSWORD="{DBPASSWORD}" psql -h xxx.xxx.xxx.xx -U {DBUSER} >> restore.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment