Last active
September 25, 2015 13:38
-
-
Save biske/6d6be7e06fe6d0778d56 to your computer and use it in GitHub Desktop.
backup and restore database from heroku to local env
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
$ heroku pg:backups -a tti-cedar | |
$ curl -o tmp/legacy-a665.dump "urlfrompreviouscommand" | |
Remove all conections to database (for example shut down rails servers or rails console). | |
# From legacy project: | |
$ bundle exec rake db:drop | |
$ bundle exec rake db:create | |
$ pg_restore --verbose --clean --no-acl --no-owner -h localhost -U ivanbisevac1 -d tti_development tmp/legacy-a665.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