Sanitize the data while moving DB from one instance to another

Comments

joshi.rohit100 created an issue. See original summary.

joshi.rohit100’s picture

Status: Active » Needs review
joshi.rohit100’s picture

StatusFileSize
new655 bytes

Forgot to upload patch :)

joshi.rohit100’s picture

StatusFileSize
new772 bytes

Bootstraping drupal

joshi.rohit100’s picture

StatusFileSize
new510 bytes
nielsvm’s picture

Project: Acquia Purge » Purge
Version: 8.x-1.x-dev » 8.x-3.x-dev
Status: Needs review » Needs work

I like this thought, although it should definitely be part of purge_drush and not live in downstream modules.

Thank you!

joshi.rohit100’s picture

Status: Needs work » Needs review
StatusFileSize
new695 bytes
nielsvm’s picture

I looked into this and unfortunately decided against accepting this actual patch.

As I said, I love the idea, but the problem I have with this approach is that it makes drush sql-sanitize do something the user totally doesn't expect. Let's see how the command is described:

$ drush help sql-sanitize
Sanitize the database by removing or obfuscating user data.

Commandfiles may add custom operations by implementing:
 - @hook_on-event sql-sanitize-message
     Display summary to user before confirmation.
 - @hook post-command sql-sanitize
     Run queries or call APIs to perform sanitizing

Examples:
  drush sql-sanitize --sanitize-password=no            Sanitize database without modifying any        
                                                       passwords.                                     
  drush sql-sanitize                                   Sanitizes database but exempts two user fields 
 --whitelist-fields=field_biography,field_phone_number from modification.                             

Its very clearly aimed at user data, and no matter how I look at it, the purge queue contains state data and not barely ever privacy sensitive data. I do agree that we need something clever that clears the queue automatically just after a deployment, and I'll think further about how to do this.

moshe weitzman’s picture

Drush team plans to clear state data in sql-sanitize. So this patch is reasonable IMO. See https://github.com/drush-ops/drush/issues/2798

japerry’s picture

Status: Needs review » Closed (won't fix)