This is how I import db from Heroku Postgres to local Postgres db:
heroku pg:backups:capture -a your-app-name
heroku pg:backups:download -a your-app-name
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U your_local_db_username -d your_local_db_name latest.dump.[number of dump]
I want to know where Heroku stored the latest.dump file from step number 2 in my computer. In which folder? Heroku silent about it...
By default, it just puts it wherever you are on the filesystem when you run the command. If you didn't use the -a
/ --app
argument, that's probably your project directory since Heroku would have to infer your app from your Git remotes.
You can use the -o
/ --output
argument to put it elsewhere or give it a different name:
-o, --output=output location to download to. Defaults to latest.dump