1

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?

  • I wonder why it's stopping at wp-config path. What is wp cli version and wp core version returning you? And wp core is-installed && echo $? should return you a 0 if installed. I only had this yesterday, locally, but couldn't reproduce it anymore after I imported a fresh live database dump again. – leymannx Apr 30 '19 at 17:38
  • Have a look at your PHP errors. I've seen WP CLI fail like that because PHP fatals out. – Welcher May 1 '19 at 2:40
0

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

|improve this answer|||||
  • Not sure why the downvote - I guess this is better as a comment instead? – Welcher May 1 '19 at 2:40
  • Thanks for the tip. – Michael Ecklund May 7 '19 at 14:37
0

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
|improve this answer|||||

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.