https://devcenter.heroku.com/articles/heroku-postgres-import-export
or
- Create a new database backup -
heroku pg:backups capture
- Request and copy the URL -
heroku pg:backups public-url
- Download the database backup -
curl "[the url]" > tmp/db.dump
- Restore the backup -
pg_restore --verbose --clean --no-acl --no-owner -h localhost -d [db_name] tmp/db.dump