Command: heroku pgbackups:capture --remote production
Response: >>> HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a712
Command: heroku pgbackups:url [db_key] --remote production
Example: heroku pgbackups:url a712 --remote production
>>> "https://s3.amazonaws.com/hkpgbackups/app11111118@heroku.com/a712.dump?AWSAccessKeyId=XXXXXXXXXXXXXX&Expires=1367876175&Signature=XXXXXXX%EEEEEEEYWWWWWWW%3D"
Command: curl "http://[url]" > production.dump
Example: curl "https://s3.amazonaws.com/hkpgbackups/app11111118@heroku.com/a712.dump?AWSAccessKeyId=XXXXXXXXXXXXXX&Expires=1367876175&Signature=XXXXXXX%EEEEEEEYWWWWWWW%3D" > production.dump
Command: pg_restore --verbose --clean --no-acl --no-owner -h localhost -d [db_name] production.dump
Here is a rake task to perform this: https://gist.github.com/benbartling/c03de6b43bd5c150d717bc92c6017dd1
It has options to capture a new backup, download the latest backup, or just restore from an already downloaded backup.