Troubleshooting and FAQ¶
A field is missing from the table¶
The table lists only stored text columns. See What the forms offer. Safe Search and Replace lists only revisionable entity types, so users, files and path aliases appear only in Search and Replace.
Safe Search and Replace changes fewer entities than Search found¶
Entities the user may not update are skipped and counted under Skipped, no update access. Entities the user may not view are not found. With Content Moderation, an entity only counts as updatable if the user may use a transition from its current state.
Drafts¶
Safe Search and Replace changes the default revision and, if there is one, the newer draft. Older revisions keep the old text.
Search and Replace changes every revision, drafts included.
Some values were skipped¶
With an option changed, matching runs in PHP. A value with invalid UTF-8, or a
regular expression that exceeds PCRE's backtracking limit on a value, leaves
that value unchanged. The snr log channel records how many were skipped per
table and column. Simplify the pattern, or fix the value by hand.
Ignoring case with accented letters¶
To narrow the rows read, Search and Replace uses LIKE when the search text
is ASCII. A case-insensitive search with non-ASCII letters reads every
non-empty row instead, so it is slower but complete. On MySQL with a binary
(_bin) collation, LIKE is case-sensitive; turn Match case on there, or
use a regular expression with (?i).
Search results, Views or caches show the old text after a direct replace¶
Search and Replace clears the entity cache and the cache tags of each changed entity. It does not run entity hooks, so search indexes (Search API, core Search) are not updated. Reindex after a direct replace.
Serialized data¶
Columns marked as serialized in the field schema are not offered. A module that stores serialized PHP in an ordinary text column can break if the replacement changes the length of a string inside it. Test on a copy of the database first.
Can I undo a replacement?¶
Search and Replace: no. Restore the database backup.
Safe Search and Replace: revert each entity to its previous revision from its Revisions tab. The revision log message names the search and replace text.
Can I use wildcards or regular expressions?¶
Check Regular expression under Matching and enter a PCRE pattern without delimiters. Without it, the text is matched literally.
The form is slow to load¶
The table lists every text column of every bundle. On sites with many bundles and fields it is long; use the filters. The list is built from the entity field definitions, which core caches.
Which databases are supported?¶
The tests run on MySQL 8 and SQLite. Search and Replace matches with
LIKE BINARY on MySQL, MariaDB and PostgreSQL, and with LIKE and the
case_sensitive_like pragma on SQLite, so the search is case-sensitive like
REPLACE(). PostgreSQL is untested.