release mu-migration 0.7.0

This commit is contained in:
release bot committed 2026-10-09 13:31:02 +00:00
1 parent e153487341
commit 444e7978da
3 files changed
+5 -5

No files matched your search

+5 -5
View File
@@ -1,13 +1,13 @@
{
"name": "MU Migration",
"slug": "mu-migration",
"version": "0.6.0",
"download_url": "https://gitea.mulligan.casa/wordpress/wp-updates/raw/branch/main/mu-migration/mu-migration-0.6.0.zip",
"version": "0.7.0",
"download_url": "https://gitea.mulligan.casa/wordpress/wp-updates/raw/branch/main/mu-migration/mu-migration-0.7.0.zip",
"homepage": "https://gitea.mulligan.casa/wordpress/mu-migration",
"requires": "6.1",
"tested": "7.0",
"requires_php": "8.1",
"last_updated": "2026-10-06 19:50:32",
"last_updated": "2026-10-09 13:31:01",
"author": "Mike Mulligan",
"author_homepage": "https://gitea.mulligan.casa/mmulligan",
"tags": [
@@ -18,8 +18,8 @@
"import"
],
"sections": {
"description": "<p>MU Migration adds a <code>wp mu-migration</code> command family to WP-CLI. It exports a site's tables, users, and optionally its plugins, themes and uploads into one zip package, then imports that package into a multisite network as a new or existing subsite, or into a single site. On import it rewrites the table prefix, remaps user ids into the network's shared users table, runs the URL and uploads-path search-replaces, and performs the housekeeping a moved site needs.</p>\n<p>This is a maintained fork of MU-Migration, created by Nícholas André at 10up and archived on 2 March 2026. The fork runs on current PHP, ships as an ordinary plugin with self-hosted updates, and plans every run before it does anything.</p>\n<p><strong>Commands</strong></p>\n<ul>\n<li><code>wp mu-migration export all &lt;zip&gt;</code> exports tables, users and meta data, plus <code>--plugins</code>, <code>--themes</code> and <code>--uploads</code> when asked. The <code>&lt;zip&gt;</code> is required.</li>\n<li><code>wp mu-migration export tables &lt;file&gt;</code> and <code>export users &lt;file&gt;</code> export one piece at a time; the <code>&lt;file&gt;</code> is required.</li>\n<li>Every export reads one site: <code>--blog-id</code>, or without it the site WP-CLI runs against (<code>--url</code>, or the main site).</li>\n<li><code>wp mu-migration import all &lt;zip&gt;</code> imports a package: into a new subsite at <code>--new-url</code> (or the package's own address with <code>--same-url</code>), or over an existing site with <code>--blog-id</code>. <code>--uid-fields</code> and <code>--uid-columns</code> name the post-meta keys and the plugin table columns that hold user ids. <code>--upload-collisions=keep</code> or <code>--upload-collisions=replace</code> says what to do with a package upload already on the site with other content, which otherwise refuses the import. <code>--installed-versions=keep</code> or <code>--installed-versions=replace</code> says what to do with a requested plugin or theme installed at another version than the package's copy, which otherwise refuses it too. Each <code>replace</code> needs <code>--backup-dir</code>, and replacing a plugin or theme another site of the network runs needs <code>--dangerously-allow-shared-code-replace</code>.</li>\n<li><code>wp mu-migration import tables &lt;file&gt; --blog-id=&lt;id&gt;</code> and <code>import users &lt;file&gt; --blog-id=&lt;id&gt; --map-file=&lt;map&gt;</code> import one piece at a time; <code>--map-file</code> is required and names where the old-id to new-id map is written.</li>\n<li><code>wp mu-migration posts update_author &lt;map&gt; --blog-id=&lt;id&gt;</code> remaps post authors, comment authors, link owners (<code>links.link_owner</code>), each post's last editor (<code>_edit_last</code>), <code>--uid-fields</code> post meta and the <code>--uid-columns</code> columns (<code>--uid-columns=em_events.event_owner</code>) to the new user ids. <code>import all</code> remaps the same.</li>\n<li><code>wp mu-migration users update_passwords</code> sets or resets passwords after a move.</li>\n<li><code>wp mu-migration info</code> prints the tool's version.</li>\n</ul>\n<p><strong>Plan, refuse, confirm, apply</strong></p>\n<p>Every command first builds a plan by running its real logic against recording executors: reads are real, and every write becomes a plan step with its exact arguments. The dump is copied, rewritten and scanned inside a private work directory, and each search-replace runs as <code>wp search-replace --dry-run --report</code> so the plan carries real counts. The plan is printed before anything is applied.</p>\n<ul>\n<li><code>--dry-run</code> stops there and closes with <code>Dry run: N steps planned; this tool wrote nothing outside its private work directory, which is removed when this run ends.</code> The site's own code can still write: WP-CLI loads the site's theme and plugins, and an import into an existing site previews each search-replace in a child that loads the target site's theme and plugins, which may write as any request to the site would. The closing line, the step, a declined confirmation's <code>Cancelled</code> line and a refusal say so when a preview ran. Before a dry run on a site whose code writes when it loads, back up its tables or rehearse on a copy.</li>\n<li>A step that is dangerous needs its own acknowledgement flag. A live run missing one is refused before any step is applied, naming each flag and the steps that need it; a dry run reports the same list as a warning.</li>\n<li>A live run with anything to change prints a confirmation naming the target, the guarded effects, the flags given and the backup, then asks <code>Continue?</code>. <code>--yes</code> skips the question and acknowledges nothing.</li>\n<li>A live run that would ask is refused when nobody could answer: under <code>--quiet</code>, or when standard input is not an interactive terminal. A live <code>--format=json</code> rLine truncated
"description": "<p>MU Migration adds a <code>wp mu-migration</code> command family to WP-CLI. It exports a site's tables, users, and optionally its plugins, themes and uploads into one zip package, then imports that package into a multisite network as a new or existing subsite, or into a single site. On import it rewrites the table prefix, remaps user ids into the network's shared users table, rewrites the site's address and uploads path in its tables, and performs the housekeeping a moved site needs.</p>\n<p>This is a maintained fork of MU-Migration, created by Nícholas André at 10up and archived on 2 March 2026. The fork runs on current PHP, ships as an ordinary plugin with self-hosted updates, and plans every run before it does anything.</p>\n<p><strong>Commands</strong></p>\n<ul>\n<li><code>wp mu-migration export all &lt;zip&gt;</code> exports tables, users and meta data, plus <code>--plugins</code>, <code>--themes</code> and <code>--uploads</code> when asked. The <code>&lt;zip&gt;</code> is required.</li>\n<li><code>wp mu-migration export tables &lt;file&gt;</code> and <code>export users &lt;file&gt;</code> export one piece at a time; the <code>&lt;file&gt;</code> is required.</li>\n<li>Every export reads one site: <code>--blog-id</code>, or without it the site WP-CLI runs against (<code>--url</code>, or the main site).</li>\n<li><code>wp mu-migration import all &lt;zip&gt;</code> imports a package: into a new subsite at <code>--new-url</code> (or the package's own address with <code>--same-url</code>), or over an existing site with <code>--blog-id</code>. <code>--uid-fields</code> and <code>--uid-columns</code> name the post-meta keys and the plugin table columns that hold user ids. <code>--upload-collisions=keep</code> or <code>--upload-collisions=replace</code> says what to do with a package upload already on the site with other content, which otherwise refuses the import. <code>--installed-versions=keep</code> or <code>--installed-versions=replace</code> says what to do with a requested plugin or theme installed at another version than the package's copy, which otherwise refuses it too. Each <code>replace</code> needs <code>--backup-dir</code>, and replacing a plugin or theme another site of the network runs needs <code>--dangerously-allow-shared-code-replace</code>.</li>\n<li><code>wp mu-migration import tables &lt;file&gt; --blog-id=&lt;id&gt;</code> and <code>import users &lt;file&gt; --blog-id=&lt;id&gt; --map-file=&lt;map&gt;</code> import one piece at a time; <code>--map-file</code> is required and names where the old-id to new-id map is written.</li>\n<li><code>wp mu-migration posts update_author &lt;map&gt; --blog-id=&lt;id&gt;</code> remaps post authors, comment authors, link owners (<code>links.link_owner</code>), each post's last editor (<code>_edit_last</code>), <code>--uid-fields</code> post meta and the <code>--uid-columns</code> columns (<code>--uid-columns=em_events.event_owner</code>) to the new user ids. <code>import all</code> remaps the same.</li>\n<li><code>wp mu-migration users update_passwords</code> sets or resets passwords after a move.</li>\n<li><code>wp mu-migration info</code> prints the tool's version.</li>\n</ul>\n<p><strong>Plan, refuse, confirm, apply</strong></p>\n<p>Every command first builds a plan by running its real logic against recording executors: reads are real, and every write becomes a plan step with its exact arguments. The dump is copied, rewritten and scanned inside a private work directory, and every check of the URL rewrite that needs no imported row is made, so a rewrite that cannot run is refused before anything is written. The plan is printed before anything is applied.</p>\n<ul>\n<li><code>--dry-run</code> stops there and closes with <code>Dry run: N steps planned; this tool wrote nothing outside its private work directory, which is removed when this run ends.</code> This tool starts no process that loads the target site's code, unserializes nothing, and counts nothing the URL rewrite would change, since those rows are the import's. The site's own code can still write: WP-CLI itself has already loaded the site it runs against (<code>--url</code>, or the main site) with its theme and plugins, network-active plugins included. Before a dry run on a site whose code writes when it loads, back up its tables or rehearse on a copy.</li>\n<li>A step that is dangerous needs its own acknowledgement flag. A live run missing one is refused before any step is applied, naming each flag and the steps that need it; a dry run reports the same list as a warning.</li>\n<li>A live run with anything to change prints a confirmation naming the target, the guarded effects, the flags given and the backup, then asks <code>Continue?</code>. <code>--yes</code> skips the question and acknowledges nothing.</li>\n<li>A live run that would ask is refused when nobody could answer: under <code>--quiet</code>, or when standard input is not an interactive terminal. A live <codLine truncated
"installation": "<ol>\n<li>Upload the plugin to <code>wp-content/plugins/</code> and activate it. On multisite, network activate it so the command is available for every site.</li>\n<li>Install it on both the site you are moving and the network you are moving it to.</li>\n<li>Run <code>wp mu-migration info</code> to confirm the command is registered.</li>\n</ol>\n<p>Requires PHP 8.1 or newer with the <code>zip</code> extension, WordPress 6.1 or newer, and WP-CLI with a <code>mysql</code> or <code>mariadb</code> client that can log in to the database server: the import, the backup and the export run WP-CLI's <code>wp db</code> commands. The MariaDB 11.8 client in the official WP-CLI Docker image cannot load <code>caching_sha2_password</code>, MySQL 8's default; against such a server, use a <code>mysql_native_password</code> database user or a MySQL client. There are no runtime Composer dependencies.</p>\n<p>Updates are delivered through the <code>Update URI</code> header and the Manifest Updater plugin.</p>",
"changelog": "<p><strong>0.6.0</strong></p>\n<ul>\n<li>Breaking: every package must be re-exported. <code>users.json</code> is format 3, and a format 2 file is refused. The users row carries <code>spam</code> and <code>deleted</code> (a network's account flags) beside <code>user_status</code>, each held to an integer in its column's range.</li>\n<li>Breaking: an account flagged spam or deleted on the source network is created flagged on a network, and refused by name on a single site, which cannot record the flags. A new user keeps its <code>user_status</code>.</li>\n<li>Breaking: a plugin whose header says <code>Network: true</code> is planned as WordPress activates it, network-wide, and needs <code>--allow-main-site</code>. Into a single site, a plugin the source ran network-active is activated on the site and stays active.</li>\n<li>Breaking: an <code>import all --plugins</code> whose dump's <code>active_plugins</code> row cannot be read while the plan is built is refused. A plugin the source ran network-active is activated before the search-replace children, so they no longer rewrite its serialized objects as empty ones; the plan notes that its activation hook runs while the site still has the old address.</li>\n<li>Breaking: on a single site, a matched user who holds no role there is given the exported role(s), as a network already did. That writes to the main site, so it needs <code>--allow-main-site</code>.</li>\n<li>Breaking: an import into an existing site whose <code>&lt;prefix&gt;options</code> table the table discovery does not find is refused, naming the prefix and the server's <code>lower_case_table_names</code>.</li>\n<li>Breaking: <code>--uid-columns=links.link_owner</code> is refused. <code>links.link_owner</code> and <code>_edit_last</code> are now remapped by default.</li>\n<li>Fixed: under a <code>sql_mode</code> holding <code>NO_BACKSLASH_ESCAPES</code>, an import into an existing site found none of its tables on MySQL, so it took no backup and asked no <code>--dangerously-allow-drop-tables</code>. The listing now escapes with <code>LIKE … ESCAPE '|'</code>. The dump import also ran under that mode and read the dump as no dump tool writes it, which let a crafted row run a <code>DROP TABLE</code>; it now runs without <code>NO_BACKSLASH_ESCAPES</code> and <code>ANSI_QUOTES</code>.</li>\n<li>Fixed: <code>users update_passwords --role</code> selected nobody for a role holding an <code>_</code> (<code>shop_manager</code>) on MySQL under that mode. The URL leftover count is the same in any <code>sql_mode</code> and counts only what the passes left.</li>\n<li>Fixed: no object is made from a stored value; role definitions and <code>active_plugins</code> are read with <code>allowed_classes</code> false. A serialized value whose length runs past its end no longer stops the plan with a TypeError.</li>\n<li>A plugin already network-active is a <code>noop</code> into a site the run creates. An activation is judged against the site as the import leaves it, read from the dump's own <code>active_plugins</code> row.</li>\n<li>The plan notes each new user whose nicename WordPress will number because another account holds it. A run that runs a search-replace child says which WP-CLI it runs under and notes when that WP-CLI's search-replace keeps only stdClass objects. What a child reports it skipped is reported in the closing lines and the JSON <code>run</code> record (<code>search_replace_warnings</code>), never as a failure.</li>\n</ul>\n<p><strong>0.5.2</strong></p>\n<ul>\n<li>Breaking: a single site's tables named the prefix, a number and an underscore (<code>wp_404_to_301</code>, <code>wp_2024_archive</code>) are exported like its others; they were left out without a word, and refused when named. Those whose number's tables include a core or network table name (<code>wp_2_posts</code>, <code>wp_2_users</code>) are another site's or install's: left out, and named in the plan.</li>\n<li>On a network, blog 1 still leaves such tables out by default, and the plan now names each with its reason: a registered site's (counted per site), another site's or install's, or one that may be the site's own.</li>\n<li>Breaking: <code>--tables</code> and <code>--non-default-tables</code> may name any of them but a registered site's (a single site has none), and the plan says it was included by name; naming a registered site's table is refused in new words. <code>posts update_author --uid-columns</code> on such a table says so too. An import into blog 1 or a single site refuses such a table unless <code>--tables</code> names it, and the plan names every one a dump brings.</li>\n<li>Breaking: <code>export all --uploads</code> from the uploads root as WordPress computes it for the network the command runs on (the main network's main site's) leaves out its <code>sites/</code> folder, which holds every other site's uploads, and the plan says so. Any other site's <code>sites/</code> folder, a single site's included, sLine truncated
"changelog": "<p><strong>0.7.0</strong></p>\n<ul>\n<li>Breaking: the URL change is one in-process step, <code>database.rewrite_urls</code>, in place of the <code>wp search-replace</code> children. It runs over the database alone, loads no site code and never unserializes: a serialized value is walked as text, only the strings holding the old address and their lengths are rewritten, and every object keeps its class and properties. Nothing in the plugin calls <code>unserialize()</code>.</li>\n<li>What the rewrite cannot change safely it leaves and counts: key columns, array keys, a malformed value, a value too long for its column, a row another writer changed (warned of, under <code>--quiet</code> too), a rewrite that would duplicate a unique key. Each row is written only if it still holds what was read, in batches of one transaction each.</li>\n<li>Breaking: an import the rewrite could not complete is refused while the plan is built: disagreeing connection charsets, a row too large for <code>max_allowed_packet</code>, a finite <code>memory_limit</code> the step would exceed, a table it cannot measure, and on MySQL a dump or backup that writes values into generated columns.</li>\n<li>Breaking: every plugin activation comes after the URL rewrite and the leftover scan, so its hook sees the new address. A dry run no longer previews the URL change.</li>\n<li>Breaking for scripts reading the JSON <code>run</code> record: <code>wp_cli_version</code>, <code>search_replace_unserialize_hook</code> and <code>search_replace_warnings</code> are gone; it carries <code>url_rewrites</code> and <code>peak_memory</code> (PHP's real peak). A <code>URL rewrite:</code> closing line reports what changed, what was left and what was skipped.</li>\n<li>A PHP fatal error during a step prints the step and its recovery block, and under JSON the <code>run</code> record still closes the output.</li>\n</ul>\n<p><strong>0.6.0</strong></p>\n<ul>\n<li>Breaking: every package must be re-exported. <code>users.json</code> is format 3, and a format 2 file is refused. The users row carries <code>spam</code> and <code>deleted</code> (a network's account flags) beside <code>user_status</code>, each held to an integer in its column's range.</li>\n<li>Breaking: an account flagged spam or deleted on the source network is created flagged on a network, and refused by name on a single site, which cannot record the flags. A new user keeps its <code>user_status</code>.</li>\n<li>Breaking: a plugin whose header says <code>Network: true</code> is planned as WordPress activates it, network-wide, and needs <code>--allow-main-site</code>. Into a single site, a plugin the source ran network-active is activated on the site and stays active.</li>\n<li>Breaking: an <code>import all --plugins</code> whose dump's <code>active_plugins</code> row cannot be read while the plan is built is refused. A plugin the source ran network-active is activated before the search-replace children, so they no longer rewrite its serialized objects as empty ones; the plan notes that its activation hook runs while the site still has the old address.</li>\n<li>Breaking: on a single site, a matched user who holds no role there is given the exported role(s), as a network already did. That writes to the main site, so it needs <code>--allow-main-site</code>.</li>\n<li>Breaking: an import into an existing site whose <code>&lt;prefix&gt;options</code> table the table discovery does not find is refused, naming the prefix and the server's <code>lower_case_table_names</code>.</li>\n<li>Breaking: <code>--uid-columns=links.link_owner</code> is refused. <code>links.link_owner</code> and <code>_edit_last</code> are now remapped by default.</li>\n<li>Fixed: under a <code>sql_mode</code> holding <code>NO_BACKSLASH_ESCAPES</code>, an import into an existing site found none of its tables on MySQL, so it took no backup and asked no <code>--dangerously-allow-drop-tables</code>. The listing now escapes with <code>LIKE … ESCAPE '|'</code>. The dump import also ran under that mode and read the dump as no dump tool writes it, which let a crafted row run a <code>DROP TABLE</code>; it now runs without <code>NO_BACKSLASH_ESCAPES</code> and <code>ANSI_QUOTES</code>.</li>\n<li>Fixed: <code>users update_passwords --role</code> selected nobody for a role holding an <code>_</code> (<code>shop_manager</code>) on MySQL under that mode. The URL leftover count is the same in any <code>sql_mode</code> and counts only what the passes left.</li>\n<li>Fixed: no object is made from a stored value; role definitions and <code>active_plugins</code> are read with <code>allowed_classes</code> false. A serialized value whose length runs past its end no longer stops the plan with a TypeError.</li>\n<li>A plugin already network-active is a <code>noop</code> into a site the run creates. An activation is judged against the site as the import leaves it, read from the dump's own <code>active_plugins</code> row.</li>\n<li>The plan noLine truncated
}
}
Binary file not shown.
Binary file not shown.