Closed paulschreiber closed 1 year ago
I've been running into the same issue lately. I have a script to pull a remote production database and run search-replace with my local dev environment's url. Search-replace doesn't make any changes, but if I run wp db search, I can see the strings wp search-replace missed.
@nickbasham-ltnow I found supplying the --all-tables
flag does what I want.
@paulschreiber I'll test that, but my problem is actually with search-replace on any table…it's simply not working, and the same with or without the --precise flag. The only thing I can think of is if this might be a problem on an M1 Mac? I wouldn't think so, but that's the only thing that's changed in my setup recently, otherwise it's the same scripts.
@nickbasham-ltnow You're describing a totally different problem. Please file a separate bug, and include the command you are running along with the output, including/especially any errors.
@paulschreiber The default behavior of search-replace
is to act on a single site only, namely the site you've provided via the --url
flag (or whatever WP-CLI defaults to when the --url
flag was not provided).
The tables that are unaffected by this default behavior are the ones that control the multisite behavior, so this is why you need to provide either --network
or --all-tables
.
Have you tried the behavior with --network
for your use case?
Describe the current, buggy behavior wp search-replace does not update the
wp_blogs
andwp_site
tables. It appears thewp_blogmeta
andwp_sitemeta
tables are also affected, but mywp_blogmeta
table is empty.Describe how other contributors can replicate this bug
$ wp search-replace terraso.org terraso.test $ mysql terraso
Describe what you would expect as the correct outcome
wp_blogs
andwp_sites
(and their meta tables) containterraso.test
instead ofterraso.org
Let us know what environment you are running this on