Drupal Database Search and Replace

This article was published in the print magazine Drupal Watchdog, Volume 6 Issue 2, , on page 13, by Linux New Media. The magazine was distributed at DrupalCon Dublin, .

For many reasons, a website's data can end up containing simple errors, such as misspelled words and obsolete numbers — far too many to fix individually. To resolve this, one could use the popular String Overrides module to always replace the erroneous values with correct ones on the fly. But this kludgy "solution" is brittle and fails to fix the underlying problem. For a Drupal 7 website, instead consider using Search and Replace Scanner, which can perform search-and-replace of plain text or regular expressions, changing the target values in all titles and fields. However, be careful, because mis-composing such a regex pattern or replacement string can wipe out far more data than is typically lost in ill-advised MySQL commands.

Copyright © 2016 Michael J. Ross. All rights reserved.
bad bots block