You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- Scrub important information from a Drupal database.
19
+
--
20
+
21
+
-- Remove all email addresses.
22
+
UPDATE users SET mail=CONCAT('user', uid, '@example.com'), init=CONCAT('user', uid, '@example.com') WHERE uid != 0;
23
+
24
+
-- Example: Disable a module by setting its system.status value to 0.
25
+
-- UPDATE system SET status = 0 WHERE name = 'securepages';
26
+
27
+
-- Example: Update or delete variables via the variable table.
28
+
-- DELETE FROM variable WHERE name='secret_key';
29
+
-- Note that to update variables the value must be a properly serialized php array.
30
+
-- UPDATE variable SET value='s:24:"http://test.gateway.com/";' WHERE name='payment_gateway';
31
+
32
+
-- IMPORTANT: If you change the variable table, clear the variables cache.
33
+
-- DELETE FROM cache WHERE cid = 'variables';
34
+
35
+
-- Scrub url aliases for non-admins since these also reveal names
36
+
-- Add the IGNORE keyword, since a user may have multiple aliases, and without
37
+
-- this keyword the attempt to store duplicate dst values causes the query to fail.
38
+
-- UPDATE IGNORE url_alias SET dst = CONCAT('users/', REPLACE(src,'/', '')) WHERE src IN (SELECT CONCAT('user/', u.uid) FROM users u WHERE u.uid NOT IN (SELECT uid FROM users_roles WHERE rid=3) AND u.uid > 0);
39
+
40
+
-- don't leave e-mail addresses, etc in comments table.
41
+
-- UPDATE comments SET name='Anonymous', mail='', homepage='http://example.com' WHERE uid=0;
42
+
43
+
-- Scrub webform submissions.
44
+
-- UPDATE webform_submitted_data set data='*scrubbed*';
45
+
46
+
-- remove sensitive customer data from custom module
47
+
-- TRUNCATE custom_customer_lead_data;
48
+
49
+
-- USER PASSWORDS
50
+
-- These statements assume you want to preserve real passwords for developers. Change 'rid=3' to the
51
+
-- developer or test role you want to preserve.
52
+
53
+
-- DRUPAL 6
54
+
-- Remove passwords unless users have 'developer role'
55
+
-- UPDATE users SET pass=md5('devpassword') WHERE uid IN (SELECT uid FROM users_roles WHERE rid=3) AND uid > 0;
56
+
57
+
-- Admin user should not be same but not really well known
58
+
-- UPDATE users SET pass = MD5('supersecret!') WHERE uid = 1;
59
+
60
+
-- DRUPAL 7
61
+
-- Drupal 7 requires sites to generate a hashed password specific to their site. A script in the
62
+
-- docroot/scripts directory is provided for doing this. From your docroot run the following:
63
+
--
64
+
-- scripts/password-hash.sh password
65
+
--
66
+
-- this will generate a hash for the password "password". In the following statements replace
67
+
-- $REPLACE THIS$ with your generated hash.
68
+
69
+
-- Remove passwords unless users have 'developer role'
70
+
-- UPDATE users SET pass='$REPLACE THIS$' WHERE uid IN (SELECT uid FROM users_roles WHERE rid=3) AND uid > 0;
71
+
72
+
-- Admin user should not be same but not really well known
73
+
-- UPDATE users SET pass='$REPLACE THIS$' WHERE uid = 1;
0 commit comments