Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Copying a Heroku DB to dokku-psql-single-container.
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