What would be the recommeded way of copying the production database into staging? Let's say the a link to the production db dump is already available to the staging server.
When doing it by hand, I have to:
- stop any pods with apps that are connected to the db. In my case, it's the web app and the worker app
- drop and recreate the staging db
- run pg_restore on a pod (via Job, or I create a one-off pod to call
pg_restore
from)
I have some ideas but I'd like to know what others have made.
I'm hoping for something that can be as simple as heroku:
heroku pg:backups restore `heroku pg:backups public-url -r production` -r staging