10up / MU-Migration

This WP-CLI plugin makes the process of moving sites from single WordPress sites to a Multisite instance (or vice-versa) much easier. It exports everything into a zip package which can be used to automatically import it within the desired Multisite installation.
MIT License
329 stars 47 forks source link

Imported subsite is not working #70

Open derekPrivate opened 4 years ago

derekPrivate commented 4 years ago

I export a subsite from a live system:

wp mu-migration export all subsite.zip --blog_id=2 --path=/var/www/html/wordpress --plugins --themes --uploads

I then import into a new (clean, multisite) Wordpress installation:

wp mu-migration import all subsite.zip --new_url=mynewsite.com/wordpress/subsite --blog_id=2

When finished, the site appears in the list of sites in the Network Admin, but if I try to Visit Site or show the Dashboard, I get a connection timeout error in my browser.

One curious thing is that during the import, I see the following messages: Extracting zip package... Importing tables... Warning: Something went wrong while running sed Warning: Something went wrong while running sed Warning: Something went wrong while running sed Warning: Something went wrong while running sed Warning: Something went wrong while running sed Warning: Something went wrong while running sed Warning: Something went wrong while running sed Warning: Something went wrong while running sed Moving files... etc...

Any ideas on why this is not working? Anything I can try to help track down the issue? Note that the default site continues to work, and I can still access the Network Admin pages, just not my imported subsite.

p.s. this is a new Wordpress install, so I can easily delete Wordpress and database, and set it up again - takes me less than 5 minutes!

derekPrivate commented 4 years ago

Should have mentioned - I am using Wordpress 5.3.

nicholasio commented 4 years ago

@derekPrivate it looks like the server you're running MU-MIgration either does not have sed or something is wrong with it.

Can you run this on your terminal and let me know the result?

echo "wp_" | sed "s/wp_/wp_5_/g"

derekPrivate commented 4 years ago

% echo "wp" | sed "s/wp/wp5/g" wp5

-- Derek

On 3 Dec 2019, at 12:19, Nícholas André notifications@github.com wrote:

echo "wp" | sed "s/wp/wp5/g"

nicholasio commented 4 years ago

Are you running MU-Migration in a linux server?

derekPrivate commented 4 years ago

I’m exporting on Linux and importing into a Mac. (Catalina, 10.5)

-- Derek

On 3 Dec 2019, at 12:28, Nícholas André notifications@github.com wrote:

Are you running MU-Migration in a linux server?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/10up/MU-Migration/issues/70?email_source=notifications&email_token=ABU4OWDCODY3ANR4VSY3SMDQWZGFVA5CNFSM4JTHBFO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFZGOXQ#issuecomment-561145694, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABU4OWFEDKWE2XWAGGGZKGTQWZGFVANCNFSM4JTHBFOQ.

nicholasio commented 4 years ago

This CLI tool has no official support for Mac OS, but I guess it shouldn't be too hard to come up with a fix for Mac OS, sed works a bit different on Mac OS when compared to Linux and that's probably why the sed commands this tool run is not working for you.

nicholasio commented 4 years ago

This is where the sed commands run in case you want to try something: https://github.com/10up/MU-Migration/blob/master/includes/commands/class-mu-migration-import.php#L663

I'll see what I can find.

nicholasio commented 4 years ago

@derekPrivate Can you try replacing this line https://github.com/10up/MU-Migration/blob/master/includes/commands/class-mu-migration-import.php#L685 with this:

sed -i'' -e '$sed_command' $filename

derekPrivate commented 4 years ago

Ok that solved the sed error, but now I do not see my website at all!

Previously, I saw the sed errors, but my website did appear in the list of sites in my wordpress installation (but the site did not work!)

Now, I see no errors during the import, but my website does not now appear in the list of sites

-- Derek

On 3 Dec 2019, at 12:48, Nícholas André notifications@github.com wrote:

@derekPrivate https://github.com/derekPrivate Can you try replacing this line https://github.com/10up/MU-Migration/blob/master/includes/commands/class-mu-migration-import.php#L685 https://github.com/10up/MU-Migration/blob/master/includes/commands/class-mu-migration-import.php#L685 with this: sed -i'' -e '$sed_command' $filename

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/10up/MU-Migration/issues/70?email_source=notifications&email_token=ABU4OWGI4E5AAUZQDDJRIADQWZIRHA5CNFSM4JTHBFO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFZICLA#issuecomment-561152300, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABU4OWCY7WGJTPOLU6GZWTDQWZIRHANCNFSM4JTHBFOQ.

Olya-Tom commented 1 year ago

Hello, the same sed error. I use WSL, only the site is not being imported, here is the error ERROR 1050 (42S01) at line 25 in file: 'mu-migration1669197215/mu-migration-1090416661oneadvocate-eu.sql': Table 'wp_addonlibrary_addons' already exists , I tried deleting the entire site and tables in turn, etc, nothing it doesn't help. but this happens when I import to a multisite blog_id=2 if I import without blog_id, then everything works. I tried to change these lines sed -i'' -e '$sed_command' $filename no effect, and % echo "wp_" | sed "s/wp_/wp_5_/g"
wp_5_