dev db taks to anonymize, and isolate data #18188
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What are you trying to accomplish?
Anonymization
Sometimes we would like to debug data of some OpenProject instance without exposing any data at all.
For that we have the
script/anonymize-sql-dump
script. The script makes some quite specific assumptions, which can make it tricky to use.This is why I've added a rake task that does the same thing but simply on the currently connected database.
bundle exec rake development:db:anonymize
Isolation
Secondly, there are other times when someone would like to restore a backup or snapshot of their environment and host it to copy over deleted data into the current production environment.
For this it I have added another rake task that leaves the data broadly unchanged but removes everything that would cause the restored environment to communicate with the outside world, e.g. via email. It 'isolates' it, if you will.
If you can come up with a better name, I'm all ears.
bundle exec rake development:db:isolate