Last active
October 17, 2018 15:43
-
-
Save salaros/a04736c2c8d65a32239631d96fc62c70 to your computer and use it in GitHub Desktop.
Use pg_restore to restore a binary PostgreSQL dump made by pg_dump
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
pg_dump -Fc --no-owner --no-privileges --no-tablespaces --clean --schema public --dbname=postgresql://username1:password1@localhost/dbname1 > /tmp/dbname1.bak | |
pg_restore -Fc --dbname=postgresql://username2:password2@localhost/dbname2 /tmp/dbname1.bak | |
rm -rfv /tmp/dbname1.bak |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment