Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wp core update-db --network only updates the first network for "multinetwork" install #224

Open
javiercasares opened this issue Oct 25, 2021 · 2 comments

Comments

@javiercasares
Copy link

Hello! I've been trying something but doesn't work fine.

I have a WordPress MultiNetwork installed (for a client) and I've been trying to do this command wp core update-db like a network, but doesn't update everything.

wp core update-db --network --path=/web/example.com/

This updates the "first" multisite, as expected.

But, there are 2 networks, and inside each one, there are some subsites. If I execute

wp core update-db --network --url="network1.com" --path=/web/example.com/

Or any other "url" it always executes the first multisite in the network.

I think there are 2 possibles solutions there. The first one (I think that will the best one) is to run

wp core update-db --network --path=/web/example.com/

and check all the subsites (whatever network they are). I think maybe check all the sites in the database active or not (because archived sites should also update the database tables).

The other case may be to use the --url parameter with the main hostname (in a multinetwork you have hostnames and then subfolders), so if you use the --url parameter, check al the sites for this network.

@danielbachhuber danielbachhuber changed the title wp core update-db for "multinetwork" wp core update-db --network only updates the first network for "multinetwork" install Jan 30, 2023
@danielbachhuber danielbachhuber transferred this issue from wp-cli/wp-cli Jan 30, 2023
@danielbachhuber
Copy link
Member

Thanks for the report, @javiercasares !

The other case may be to use the --url parameter with the main hostname (in a multinetwork you have hostnames and then subfolders), so if you use the --url parameter, check al the sites for this network.

I think this approach probably makes more sense.

Out of curiosity, how does WordPress core handle this for the web?

@javiercasares
Copy link
Author

Out of curiosity, how does WordPress core handle this for the web?

You need to do the process in each Network. When you execute the Update process in Network A, only lists the sites in Network A, and Network B, lists sites in B.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants