Last active
December 16, 2018 03:36
-
-
Save abhishek77in/2e0326bcbc5be8fd0ceb to your computer and use it in GitHub Desktop.
Import heroku database to local machine
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 pg:backups:capture --app sushi | |
curl -o latest.dump `heroku pg:backups public-url --app sushi` | |
curl -o latest.dump `heroku pg:backups:url b001 --app sushi` | |
pg_restore --verbose --clean --no-acl --no-owner -d <app_name>_development latest.dump | |
# Restore data from trial server | |
curl -o latest.dump `heroku pg:backups public-url --app labsmart-trial` | |
be rake db:drop db:create | |
pg_restore --verbose --clean --no-acl --no-owner -d azurite_development latest.dump | |
# To copy prodcution data to staging app | |
heroku pg:backups restore `heroku pgbackups:url -a production-app` DATABASE -a staging-app | |
# Store prodcution data to staging | |
heroku pg:backups restore `heroku pgbackups:url -a production-app` DATABASE -a staging-app | |
heroku pg:backups restore b001 DATABASE_URL --app sushi | |
heroku pg:copy DATABASE_URL HEROKU_POSTGRESQL_PINK_URL --app sushi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment