First download a dump of the database as per devcenter.heroku.com/articles/heroku-postgres-import-export with :
This produces a file
web/bin/pg_dump_heroku
latest.dump
. If that already exists, it produces latest.dump.1
and so on.Then restore it to a local database like in Section "Save and restore local PostgreSQL development database". First we nuke the database completely with
We also add some extra flags to reduce the ammount of warnings due to database differences. devcenter.heroku.com/articles/heroku-postgres-import-export says some of those warnings are normal and can be ignored.
web/bin/pg-setup
to increase accuracy:
web/bin/pg-setup
web/bin/pg_restore --no-acl --no-owner latest.dump