Skip to content

scrub database dump: herokudump.py cmd#225

Open
odo-sfct wants to merge 1 commit intoow/scrub-script-heroku-clifrom
ow/scrub-script-manage
Open

scrub database dump: herokudump.py cmd#225
odo-sfct wants to merge 1 commit intoow/scrub-script-heroku-clifrom
ow/scrub-script-manage

Conversation

@odo-sfct
Copy link
Copy Markdown
Contributor

@odo-sfct odo-sfct commented Jun 9, 2024

Part 1 | Part 2 | Part 3

Run the command as:
heroku login
python manage.py herokudump iwalk-test
inside the server container with Django server up.
Where iwalk-test can be -staging or prod

It'll download the appropriate database and scrub it before restoring the local dump.
It works with you current as it runs a pg_restore with a clean, so it'll overwrite the data you have currently.
Best practice is do drop what you have locally first to get a clean slate, but it's been built so that it's not necessary.

There will be use cases where you would not want to scrub:

  • Testing specific migrations on exact emails/names
  • Running queries using those emails/names locally

Since that occasion is rarer, we leave that process to be manual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant