Open ppiotr3k opened 5 years ago
@ppiotr3k Are you importing the exported site in the same subsite? If so this is very likely an unhandled edge case, since when the search-replace takes place to replace the URL, it affects both subsites given they both have the same URL/Domain at the time search-replace is run and since search-replace is performed with the --network
flag it catches both sites. You'd have the same issue if you didn't provide --new_url
and tried to run search-replace afterwards with the --network
flag.
We can probably solve this by restricting the search-replace to the imported subsite and handling the search-replace of the necessary global tables manually.
@nicholasio I confirm this is an export/import in the same WordPress multisite deployment. The export/import features are used as a cloning operation, providing a new URL for the target during import.
Also, I haven't noticed previously, but indeed the URL is replaced in the source site in other places as well, with the target site URL, as explained in your possible cause analysis :clap:
Confirmed this is an issue for me as well.
For others following, my workaround was to use wp-cli to change the site address to the "new site address" prior to exporting. Once the export is done, the script changes the site address back. Then, upon importing, you don't need to specify a new address.
I think I've mostly finished with the bash script, if anyone is interested lmk and I'll finish it up and provide.
I think I've mostly finished with the bash script, if anyone is interested lmk and I'll finish it up and provide.
Hey @jmtornetta, still got that script somewhere? :)
Describe the bug
When cloning a subsite in a multisite install using export/import, the source subsite domain is updated to the target subsite URL.
Steps to Reproduce
wp mu-migration export all --blog_id=8 /tmp/blog_template.zip --themes --plugins --uploads
wp mu-migration import all /tmp/blog_template.zip --new_url="https://mynew.url"
domain
in DBExpected behavior
source subsite is not affected by the creation of a new subsite when using export/import with
--new_url