Closed Bug 980874 Opened 10 years ago Closed 10 years ago

[remo] Prod database dump

Categories

(Data & BI Services Team :: DB: MySQL, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: giorgos, Unassigned)

References

Details

We need a prod database dump to run same data migration tests before pushing to production. Preferably today or on Monday we want to have this if possible.

Host: reps.mozilla.org

Because this contains some private emails can you please send it to my google drive?

Thanks!
Assignee: server-ops-webops → server-ops-database
Component: WebOps: Engagement → Server Operations: Database
Product: Infrastructure & Operations → mozilla.org
QA Contact: nmaul → scabral
Moving this to the database team as they have familiarity with the rules and procedures around providing a dump of production data with PII to developers for local development and testing
Can we sanitize the emails at all? or do you need the exact data?
:sheeri, sanitizing emails is great. Thanks for asking.
I have sanitized the e-mails by doing a SHA1 hash of the e-mail address, and taking the first N letters of that as the username. N is the number of letters in the original email username.

e.g. scabral@company.com becomes 0954718@company.com

Here's how I did it - I imported a backup to a new db (sanitized_reps_mozilla_org), and then:

use sanitized_reps_mozilla_org;

UPDATE profiles_userprofile 
SET private_email = CONCAT(LEFT(sha1(private_email) , LOCATE('@',private_email)-1), 
SUBSTRING(private_email,LOCATE('@',private_email)))
WHERE 1=1;

UPDATE auth_user
SET email = CONCAT(LEFT(sha1(email) , LOCATE('@',email)-1), 
SUBSTRING(email,LOCATE('@',email)))
WHERE 1=1;

I'll export this and get this to you post-haste.
Put up in Google Drive...resolve if it looks good!
Thanks for the quick response Sheeri!
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Product: mozilla.org → Data & BI Services Team
You need to log in before you can comment on or make changes to this bug.