Sanitize User Table in Drupal

Sanitize User Table in Drupal

#!/bin/bash drush sqlq "UPDATE {users} SET pass = md5('pass') WHERE uid > 1;" drush sqlq "UPDATE {users} SET mail = concat('myaddr+', replace(mail, '@', '_'), '@testdomain.org') WHERE uid 0 AND instr(mail, '@testdomain.org') = 0;" These drush commands will set all users that are not anonymous or user 1 to password "pass" and sanitize all email addresses. dustinc@getlevelten.com becomes myaddr+dustinc_getlevelten.com@testdomain.org drush has a --sanitize opt for sql-sync, and this code works the same way --sanitize works but will do it outside of synching a database.

Related Posts

Creating and Growing a Drupal User Group

David Hahn
Read more

Using Drupal 7 Entity Reference to help Create User Dashboards

Brent Bice
Read more

User Moderation Sandbox Project for Drupal - Community Management of New Users to Avoid Spammers and Trolls

Kristin Brinner
Read more

Wordpress vs Drupal: User's Edition

Kyle Taylor
Read more

Synchronize one drupal site with another using Drush

Dustin Currie
Read more

How to Use User Stories to Build Your Website

Kayla Wren
Read more