Last active
April 9, 2016 16:09
-
-
Save mrrooijen/93483cef048277340b99aaa41e422835 to your computer and use it in GitHub Desktop.
Postgres Dump/Restore From/To RDS/Compose
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
export HOSTNAME_A=todo | |
export PORT_A=todo | |
export DBNAME_A=todo | |
export USERNAME_A=todo | |
export HOSTNAME_B=todo | |
export PORT_B=todo | |
export DBNAME_B=todo | |
export USERNAME_B=todo | |
pg_dump --verbose --format c \ | |
-h $HOSTNAME_A -p $PORT_A -U $USERNAME_A -d $DBNAME_A -f $DBNAME_A.dump | |
pg_restore --verbose --clean --no-acl --no-owner \ | |
-h $HOSTNAME_B -p $PORT_B -U $USERNAME_B -d $DBNAME_B $DBNAME_A.dump |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment