duncanjbrown / WP-CLI-Migrate

A database migration command for WP-CLI
32 stars 3 forks source link

Multisite Compatibility #2

Open brianfeister opened 11 years ago

brianfeister commented 11 years ago

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.

duncanjbrown commented 11 years ago

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

brianfeister commented 11 years ago

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 commented 11 years ago

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 commented 11 years ago

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.

duncanjbrown commented 11 years ago

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 notifications@github.com 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.

brianfeister commented 11 years ago

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

brianfeister commented 11 years ago

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

duncanjbrown commented 11 years ago

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

On 15 Jul 2013, at 00:32, Brian Feister notifications@github.com 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.

brianfeister commented 11 years ago

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

Sent from my iPhone

On Jul 15, 2013, at 2:57 AM, duncanjbrown notifications@github.com wrote:

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

On 15 Jul 2013, at 00:32, Brian Feister notifications@github.com 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.

carstingaxion commented 9 years ago

@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.

dnavarrojr commented 8 years ago

Bueller..? Bueller..?