WP-CLI also has powerful commands for working within WordPress Multisite. Here are a few that are helpful for working within the database.
Note: These commands are for subfolder multisite only. If you are using multiple domains in your sub sites please contact support.
One thing to note when working on multisite with WP-CLI is you'll always need to pass the url that is currently set at your top level domain in the network. If you are unsure you can find this in
wp-config-hosting.php and find the constant set for
define( 'DOMAIN_CURRENT_SITE', 'sitename.com' );
Search and Replace in WordPress Multisite, Including Serialized Arrays
wp search-replace --network 'http://old-domain.com' 'http://new-domain.com' --url=old-domain.com --all-tables
wp cache flush
Update WordPress Multisite-Specific Tables
Note: Do not use http(s):// for these steps.
wp search-replace old-domain.com new-domain.com wp_site wp_blogs