And, by the way, on the “Manage Web Apps → Manage WordPress” page, we won’t show the “Details of installed web app” table anymore! This table is currently above “WP Workbench,” but all the info from it will move to a new tab called “Dashboard” inside “WP Workbench”—this will make WP Workbench’s UX much better…
Not sure if the context here but there might be a need to have URL replacement with and without GUID scanning, there is switch on the wp replace command
you wrote
There is also
--network
flag to search/replace through all the tables registered to$wpdb
in a multisite install.
while I don’t like the usage of the word network
in this context, I am not sure of a better word … what about simply --multisite
?
These two are going to be helpful. Thank you!
wp search-replace 'example.dev' 'example.com' --skip-columns=guid
The docs say don’t ever change GUID, but this website I have just moved used the URL stored in the GUID column (which WordPress says should never be used for a URL) for a button URL. The GUID is only ever used for RSS feeds to provide a unique identifier.
I think for the most part small sites should change this, mainly from dev to live, but I thought I would just update my previous comment with the links and commands for reference if it is of any use.
Alright, cool! So, like this at the end:
And, tooltip will provide more details:
Database replacements
Run a safe WP-CLI search-and-replace across the whole ${N} database.
-
Test run
Preview the full report; nothing is written to the database. -
Use precise mode
Forces the slower, PHP-level scanner that never misses serialized data. -
Use recursion on objects
Enable recursing into objects stored in serialized values to replace strings. -
Use regular expressions
Run the search using a regular expression (without delimiters). Keep in mind, that search and replace will take about 15-20 times longer with regex enabled.
The first small text box is the delimiter (default is the invisible chr(1) character, but / or # also work fine). The second small text box takes PCRE flags:- i – Case-insensitive match
- m – Multi-line mode (^ and $ match start/end of line)
- s – Dot matches newline (dotall)
- x – Ignore whitespace and allow comments in pattern
- u – Treat pattern and subject as UTF-8
- A – Pattern must match at start of subject
- D – Dollar matches end of subject only
- U – Ungreedy mode (makes quantifiers ungreedy)
- J – Allow duplicate named subpatterns
-
Skip the given tables/columns
List names separated by commas (wildcards allowed). Check the Include instead option to turn the list into an allow-list. -
Database table selection
Choose one scope before running the command:-
Only tables registered to this site
Core plus any plugin tables that belong to the current site. -
All tables that have this site’s
prefix
Every table whose name starts with the prefix, even if it was never registered by a plugin. -
Every table in this database
Ignores the prefix and processes every table in the current database. -
Every table from every site in the multisite
network
Touches all tables for all sites when WordPress is in multisite mode.
-
Only tables registered to this site
Widgets, options and other serialized values are updated safely, nevertheless always make a backup before running the real replace.
Thanks to everyone for joining this! I consider this accomplished!
@Ilia This GUID issue is serious from my experience too. The plugin that I use for cloning WordPress sites allows to skip it (and it is on skip by default). For some projects I came across issues and since then I always include GIUD’s in the search-replace of domain name. I have faced no issues with including GUID. I can’t say how essential it is to give it as an option for the developer to skip or include it, but I would appreciate it being included.
It’s important to know the purpose of the clone. If the clone will replace the old site, then GUIDs should be left intact. However, if the clone will live alongside the original, we should regenerate GUIDs, as two public feeds with identical GUIDs will appear as duplicate stories to aggregators…