I'm maintaining a WordPress Multisite that I run a local version of using Vagrant and VMWare Fusion. I usually export a production db, import to my local Vagrant db (using SequelPro), then use the command line to vagrant ssh into the box; where I use wp cli to change domains from public ones to my local subdomain versions. (vmware configuration matches production). Before my recent OS and WP update I was using the --network flag and would do the following:

wp search-replace 'publicdomain.com' 'local-network.dev' --network --dry-run`

With my WordPress (5.4.2) and WP-CLI (WP-CLI 2.4.0) update, when I use --network I'm getting:

Error: Error establishing a database connection.`

Without the --network flag I get results, but I think I'm going to miss a bunch of tables when I do the different domains in the network.

Should I be using --all-tables instead of --network?

From the doc.

Search/replace through all the tables registered to $wpdb in a multisite install.`

I realize I don't have an understanding of $wpdb, how that works with Multisite and search-replace.

Do I have to do or include something in order to use --network? I was using this on the previous setup with WP 4.8 and WP-CLI 1.4.1.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.