Last active
October 30, 2018 20:48
-
-
Save henrik/e6817dd10d9c9a36c22a to your computer and use it in GitHub Desktop.
Copying a Heroku DB to dokku-psql-single-container.
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
cd my_heroku_app | |
# Make sure DB doesn't update on Heroku. This may be enough depending on your needs. | |
heroku maintenance:on | |
# Dump from Heroku. | |
heroku pg:pull DATABASE_URL heroku_dump | |
pg_dump heroku_dump -Fc > /tmp/db.dump # Fc for binary dump (otherwise the import will complain) | |
# Restore to Dokku. | |
scp /tmp/db.dump my-dokku-server:/tmp | |
ssh my-dokku-server "dokku psql:restore my-dokku-app < /tmp/db.dump" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment