Last active
January 23, 2018 03:16
-
-
Save seanbehan/c395e84e1844d366722c to your computer and use it in GitHub Desktop.
Export and import a Heroku database from one app to another app
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
heroku addons:create heroku-postgresql:hobby-basic | |
heroku pg:wait | |
heroku info | |
heroku pg:backups capture | |
heroku maintenance:on | |
export DB_DUMP=`heroku pg:backups public-url -a export-app-name` | |
heroku pg:backups restore $DB_DUMP DATABASE_URL -a import-app-name | |
heroku pg:copy DATABASE_URL HEROKU_POSTGRESQL_PURPLE_URL | |
heroku pg:promote HEROKU_POSTGRESQL_PURPLE_URL | |
heroku maintenance:off | |
heroku pg:info |
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 DB_DUMP=`heroku pg:backups public-url -a export-app-name` | |
heroku pg:backups restore $DB_DUMP DATABASE_URL -a import-app-name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment