Fastest way to pull a heroku database down to local
Once you have a sizeable database, using heroku's db:pull command takes ages. I found running these four steps can pull down a large production database and restoring it locally in minutes
$ curl -o latest.dump `heroku pgbackups:url`
$ rake db:reset
$ pg_restore --verbose --clean --no-acl --no-owner -h localhost -U root -d YOUR_LOCAL_DB_NAME latest.dump
$ rm latest.dump
Written by Matthew Deiters
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Heroku
Authors
Related Tags
#heroku
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#