Question

We're having trouble with the heroku fork command so are manually trying to create a staging environment. I tried creating a new database off of a backup from our prod db but the created db has no rows and is only 6.4MB. The actual backup is 15.7 GB.

I did this via the web console clicking "restore".

Whats the right way to do this?

Was it helpful?

Solution

From the command line, you want to do:

heroku pgbackups:restore DATABASE -a example-staging `heroku pgbackups:url -a example`

We use this command every few days, whenever we want the staging database to be replaced with the production database. This comes from: https://devcenter.heroku.com/articles/migrate-heroku-postgres-with-pgbackups#transfer-to-target-database

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top