First download a dump of the database as per devcenter.heroku.com/articles/heroku-postgres-import-export with :
This produces a file 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 web/bin/pg-setup to increase accuracy:
web/bin/pg_restore --no-acl --no-owner latest.dump
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.