Thursday, 18 July 2013

Heroku db:pull failed to connect to database

Heroku db:pull and db:push is now deprecated. you should consider using pgbackup, add the addons on your heroku app and then perform these simple steps:

$ heroku pgbackups:capture -a myherokuappname
$ heroku pgbackups -a myherokuappname
$ curl -o latest.dump `heroku pgbackups:url -a myherokuappname`
$ pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myusername -d mydbname latest.dump