Last active
January 30, 2019 22:19
-
-
Save xtfer/6127781 to your computer and use it in GitHub Desktop.
Sanitize a Drupal 7 database
adapted from http://drupalscout.com/knowledge-base/creating-sanitized-drupal-database-backup This sets all passwords to "password". I run this using Sequel Pro, which will continue to run when errors occur, as it treats each line as a separate transaction.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE users SET mail = CONCAT(name, '@localhost'), init = CONCAT(name, '@localhost'), pass = '$S$Cd059Vsxc8berFeg6hspaa7ejx2bSxyUisvCbT4h9o8XIgSUtPKz'; | |
UPDATE comment SET mail = CONCAT(name, '@localhost'); | |
UPDATE authmap SET authname = CONCAT(aid, '@localhost'); | |
UPDATE webform_submitted_data set data='scrubbed'; | |
TRUNCATE accesslog; | |
TRUNCATE cache; | |
TRUNCATE cache_block; | |
TRUNCATE cache_bootstrap; | |
TRUNCATE cache_field; | |
TRUNCATE cache_form; | |
TRUNCATE cache_image; | |
TRUNCATE cache_filter; | |
TRUNCATE cache_menu; | |
TRUNCATE cache_metatag; | |
TRUNCATE cache_page; | |
TRUNCATE cache_rules; | |
TRUNCATE cache_token; | |
TRUNCATE cache_update; | |
TRUNCATE cache_views; | |
TRUNCATE cache_views_data; | |
TRUNCATE devel_queries; | |
TRUNCATE devel_times; | |
TRUNCATE flood; | |
TRUNCATE history; | |
TRUNCATE search_dataset; | |
TRUNCATE search_index; | |
TRUNCATE search_total; | |
TRUNCATE sessions; | |
TRUNCATE watchdog; | |
update variable set value = 's:4:"fake";' where name = 'smtp_password'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment