Created
March 8, 2019 09:35
-
-
Save davidfurlong/772b351312ef5ce74c4acbb80352df7b to your computer and use it in GitHub Desktop.
Restoring a production heroku postgres backup into a local postgres instance on OSX
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
0. Make sure your Postgres version is the same as the heroku one (even minor version) | |
1. Download heroku backup | |
2. Add .dump extension to the file | |
3. Run | |
$ pg_restore -f mydatabase.sql mydatabase.dump | |
to convert sql dump to sql. | |
4. Find the 'Owner' name in the file and replace all with your localhost Owner (find by using \l and finding the owner of local database's Name) | |
5. psql databasename | |
6. \i mydatabasedump.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment