Try using the steps detailed here.
Basically, grab the information from your Heroku database using heroku config:get
. Look for your Heroku Postgres url. It will look something like this: HEROKU_POSTGRESQL_RED_URL: postgres://user3123:passkja83kd8@ec2-117-21-174-214.compute-1.amazonaws.com:6212/db982398
. Note that the string is configured as database://username:password@host:port/databasename
. Thus, in this example, the username
is user3123
, the database name
is db982398
. You'll need this for the next part.
Then, you'll use the information in the above postgres string to make a local copy of your Heroku database using pg_dump
. Enter the following into your terminal:
pg_dump --host=<host_name> --port=<port> --username=<username> --password --dbname=<dbname> > output.sql
In each place where <....>
is in the above code, enter your specific information. After typing this, the terminal will ask you for your password. Enter it.
Finally, you'll load that dumpfile into your local database using psql
.
psql -d <local_database_name> -f output.sql
Be sure to put the name of your local database.