Last active
November 26, 2015 17:02
-
-
Save biske/d5d2fce8bac22f1a1fb2 to your computer and use it in GitHub Desktop.
Restore database from Heroku to local environment
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
$ wget $(heroku pg:backups public-url -a legacy-next-staging) -O tmp/tti_legacy.dump | |
Remove all conections to database (for example shut down rails servers or rails console). | |
# From legacy project: | |
$ bundle exec rake db:drop db:create | |
$ pg_restore --verbose --clean --no-acl --no-owner -h localhost -U ivanbisevac1 -d tti_development tmp/tti_legacy.dump | |
$ bundle exec rake db:migrate | |
# On roundabout project: | |
$ bin/rake db:schema:dump | |
$ RAILS_ENV=test bin/rake db:schema:load |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment