wp search-replace (not executing)

I'm running multisite. Looking to replace old URLs with new URLs for pulling a copy of the site form one environment to another environment.

Here is my command:

wp search-replace --url=domain.com https://domain.com https://domain.test --all-tables --network --recurse-objects --skip-columns=guid --dry-run --allow-root --debug

WP-CLI is just taking my command and going to a new line, then returns nothing.

When I add --debug this is what I get back:

Debug (bootstrap): No readable global config found (0.093s)
Debug (bootstrap): Using project config: //wp-cli.yml (0.094s)
Debug (bootstrap): argv: /usr/local/bin/wp search-replace --url=domain.com https://domain.com https://domain.test --all-tables --network --recurse-objects --skip-columns=guid --dry-run --allow-root --debug (0.094s)
Debug (bootstrap): ABSPATH defined: /app/public/ (0.096s)
Debug (bootstrap): Set URL: domain.com (0.097s)
Debug (bootstrap): Begin WordPress load (0.102s)
Debug (bootstrap): wp-config.php path: /app/public/wp-config.php (0.103s)

I run this very same command on another installation and it runs just fine. What could cause this to fail? Differences in wp-config.php by chance? Is there anything required in wp-config.php to run properly?

Topic wp-cli command-line urls database Wordpress

Category Web


There was definitely a discrepancy with loading site related assets.

I was also executing several unnecessary parameters with my command.

I was unaware you could prevent these assets from loading during this operation. Please see the new command on how to prevent loading possible conflicting files.

I've modified it to the following and it worked as expected:

wp search-replace --url=domain.com domain.com domain.test --allow-root --all-tables --skip-themes --skip-plugins --skip-packages --verbose

Have a look at your PHP errors. I've seen WP CLI fail like that because PHP fatals out.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.