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.1and 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 withWe 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-setupto increase accuracy:
web/bin/pg-setup web/bin/pg_restore --no-acl --no-owner latest.dump