WP-CLI-Migrate icon indicating copy to clipboard operation
WP-CLI-Migrate copied to clipboard

Multisite Compatibility

Open brianfeister opened this issue 12 years ago • 11 comments

Does the WP CLI extension support multisite migrations? So far I've not had any luck - figured it was worth documenting as an issue one way or the other.

brianfeister avatar Jul 14 '13 14:07 brianfeister

In principle it should work as it's just copying the database. I haven't tested this.

duncanjbrown avatar Jul 14 '13 15:07 duncanjbrown

Ok, yeah I thought it should. I'm having issues but I need to verify that it's not something about my configuration. Trying to use this as a final step in provisioning a Vagrant box for devs to work locally.

brianfeister avatar Jul 14 '13 15:07 brianfeister

So, just to add some context here, I'm not sure how much you've worked with Multisite so forgive me if I'm re-stating the obvious here. Basically, WP-CLI treats Multisite quite a bit differently from a regular WordPress install because the actual table structure of the two is different. What I'm trying to track down and debug through your extended class is whether or not the differing table schema is accounted for.

When I run the following command

wp --path=/srv/www/cms --url=mysite.dev migrate to /srv/www/cms http://mysite.dev path/to/db.sql

I get Error: 'migrate' is not a registered wp command. See 'wp help'.. In the above command the --url=mysite.dev parameter is required for multisite installs using WP-CLI commands because it handles the magic for how tables are treated (different from the usage of WP-CLI with regular/non-multisite installs). Can you verify that this parameter would be properly passed and used by WP-CLI-Migrate? Right now it's saying that wp migrate is not a registered command and I think it's the extra parameters multisite wants/needs and are not being handed off properly by the bash command for WP-CLI-Migrate.

brianfeister avatar Jul 14 '13 15:07 brianfeister

Basically, with Multisite instances, when wp [foo] is executed, the command is just ignored with no report / result if the --url=[bar] parameter is not passed. So I need to pass --url=[multisite-primary-site], but I think that this might be working in direct opposition to the expectation of migrate.

brianfeister avatar Jul 14 '13 15:07 brianfeister

It looks as though the plugin isn't being loaded, which I suspect is because it's not network activated. Could you try putting it in mu-plugins folder, which would (I think) have the same effect and see if the command is found?

On 14 Jul 2013, at 16:36, Brian Feister [email protected] wrote:

So, just to add some context here, I'm not sure how much you've worked with Multisite so forgive me if I'm re-stating the obvious here. Basically, WP-CLI treats Multisite quite a bit differently from a regular WordPress install because the actual table structure of the two is different. What I'm trying to track down and debug through your extended class is whether or not the differing table schema is accounted for.

When I run the following command

wp --path=/srv/www/cms --url=mysite.dev migrate to /srv/www/cms http://mysite.dev path/to/db.sql I get Error: 'migrate' is not a registered wp command. See 'wp help'.. In the above command the --url=mysite.dev parameter is required for multisite installs using WP-CLI commands because it handles the magic for how tables are treated (different from the usage of WP-CLI with regular/non-multisite installs). Can you verify that this parameter would be properly passed and used by WP-CLI-Migrate? Right now it's saying that wp migrate is not a registered command and I think it's the extra parameters multisite wants/needs and are not being handed off properly by the bash command for WP-CLI-Migrate.

— Reply to this email directly or view it on GitHub.

duncanjbrown avatar Jul 14 '13 22:07 duncanjbrown

Unfortunately not, both WP-CLI-Migrate and wp-migrate-db-pro are active when trying the command image

brianfeister avatar Jul 14 '13 23:07 brianfeister

Also, here is what you requested with the plugins loaded via mu-plugins - same result: image

brianfeister avatar Jul 14 '13 23:07 brianfeister

Ah, interesting. I'll set up a multisite install and look into this.

On 15 Jul 2013, at 00:32, Brian Feister [email protected] wrote:

Also, here is what you requested with the plugins loaded via mu-plugins - same result:

— Reply to this email directly or view it on GitHub.

duncanjbrown avatar Jul 15 '13 06:07 duncanjbrown

Thanks! Yeah take a look at the details I mentioned earlier

Sent from my iPhone

On Jul 15, 2013, at 2:57 AM, duncanjbrown [email protected] wrote:

Ah, interesting. I'll set up a multisite install and look into this.

On 15 Jul 2013, at 00:32, Brian Feister [email protected] wrote:

Also, here is what you requested with the plugins loaded via mu-plugins - same result:

\ Reply to this email directly or view it on GitHub. 
Reply to this email directly or view it on GitHub.

brianfeister avatar Jul 15 '13 12:07 brianfeister

@duncanjbrown Did you found out anything on this topic? Long time ago, but right now important to me. Would be nice to hear from you here.

carstingaxion avatar Feb 03 '15 02:02 carstingaxion

Bueller..? Bueller..?

dnavarrojr avatar Mar 03 '16 00:03 dnavarrojr