I’m writing a quick post on this, because every time I do it I fck around for a while and eventually get it – so this time I am writing my steps!
And yes, I know there is documentation on Heroku, but it never quite works for me. So!
- Make sure you have a database created and migrated into which you are going to put your backup
- Capture a backup with
$heroku pg:backups capture --app rails-girls-events
- It will give you a backup id, which you can use in the next command to get the public url of that backup
$heroku pg:backups public-url b006 --app rails-girls-events
- When you visit that url, it will download to your machine
- Use the path to that download to upload it
$pg_restore --verbose --clean --no-acl --no-owner -h localhost -U tracymusung -d your-data-base-name path-to-your-download