release mu-migration 0.5.2

This commit is contained in:
release bot committed 2026-10-05 03:25:23 +00:00
1 parent 135e86da8f
commit a0299d07b4
2 files changed
+4 -4

No files matched your search

+4 -4
View File
@@ -1,13 +1,13 @@
{
"name": "MU Migration",
"slug": "mu-migration",
"version": "0.5.1",
"download_url": "https://gitea.mulligan.casa/wordpress/wp-updates/raw/branch/main/mu-migration/mu-migration-0.5.1.zip",
"version": "0.5.2",
"download_url": "https://gitea.mulligan.casa/wordpress/wp-updates/raw/branch/main/mu-migration/mu-migration-0.5.2.zip",
"homepage": "https://gitea.mulligan.casa/wordpress/mu-migration",
"requires": "6.1",
"tested": "7.0",
"requires_php": "8.1",
"last_updated": "2026-10-04 03:15:32",
"last_updated": "2026-10-05 03:25:23",
"author": "Mike Mulligan",
"author_homepage": "https://gitea.mulligan.casa/mmulligan",
"tags": [
@@ -20,6 +20,6 @@
"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, <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.</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> run needs <code>--yes</code>.</li>\n<li>The plan is applied step by step. The first failure stops the run, names the step and prints recovLine 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.5.1</strong></p>\n<ul>\n<li>Breaking: <code>export all</code> needs its <code>&lt;zip&gt;</code>, <code>export users</code> its <code>&lt;file&gt;</code> and <code>import users</code> its <code>--map-file</code>; none has a default in the working directory any more, and an empty path is refused.</li>\n<li>Breaking: <code>--new-url</code> and <code>--old-url</code> must start with <code>http://</code> or <code>https://</code> and a valid host, and may not hold <code>%</code>. A URL change whose new address is the old one plus a path is refused unless you pass <code>--dangerously-allow-nested-url</code>.</li>\n<li>Breaking: every file that carries user data (the package, the users file, a dump, the id map, the backup) is refused in a directory another user could replace it in. A missing directory for one is created owner-only.</li>\n<li>Breaking: an import over an existing site takes the source's role definitions for every role the source defines, exactly as exported, and keeps the roles only the site defines; <code>--role-definitions=destination</code> keeps the site's definitions, as before. The plan, the closing lines and the JSON <code>run</code> record (<code>role_definitions</code>) list, per role, the capabilities added and removed.</li>\n<li>Breaking: <code>import all</code> refuses a package upload already on the site with other content, naming it, unless you pass <code>--upload-collisions=keep</code> or <code>--upload-collisions=replace</code>. One with the same content is skipped. <code>replace</code> moves the site's file into <code>--backup-dir</code> first, which it needs; the undo lines put it back. The plan and the JSON <code>run</code> record (<code>upload_collisions</code>) count them.</li>\n<li>Breaking: <code>import all</code> with <code>--plugins</code> or <code>--themes</code> refuses a plugin or theme installed at another version than the package's copy, older or newer, naming both versions, unless you pass <code>--installed-versions=keep</code> or <code>--installed-versions=replace</code>. <code>replace</code> moves the installed copy into <code>--backup-dir</code> first, before anything else runs; the undo lines put it back and say to reset PHP's opcode cache. Replacing code another site of the network runs needs <code>--dangerously-allow-shared-code-replace</code>, and the refusal names those sites. The plan and the JSON <code>run</code> record (<code>installed_versions</code>) list each difference. After a replace, a live run says to reset PHP's opcode cache, in its closing lines or, under <code>--format=json</code>, as the <code>run</code> record's <code>reset_opcode_cache</code>.</li>\n<li>The plugin and theme moves come before the site is created, the backup, the import and the URL passes, so no search-replace child loads the code being replaced. A move no longer predicts a rename from device numbers: two mounts of one filesystem failed it after the import. It renames a probe file first, once per move, and copies, verified, where the probe did not keep its inode. Copies keep their modification times.</li>\n<li>Nested mounts are not supported: read from <code>/proc/self/mountinfo</code>, a mount point inside the uploads, plugin or theme tree a move places files in, or in installed code <code>--installed-versions=replace</code> would move away (a single-file plugin mounted on its own included), refuses the run while the plan is built, naming the mount point, and again just before the move. A destination that is itself a mount point is fine. Where the mount table cannot be read, the plan and the run's closing lines say nested mounts were not checked, and the run goes on.</li>\n<li>Imported uploads, plugins and themes get the modes WordPress gives them, whatever the umask: an upload its directory's mode less the execute bits, a plugin or theme <code>FS_CHMOD_FILE</code> and <code>FS_CHMOD_DIR</code>.</li>\n<li>A run that completed prints the commands that undo it (\"To undo this run:\"), the backup restore and the drop of the tables it created included; the JSON <code>run</code> record carries them as <code>undo</code>.</li>\n<li>The URL change writes the new scheme, moves every plain, JSON-escaped and URL-encoded reference whole, matches the host in any case, and never rewrites an e-mail address. A bare <code>localhost</code> is left alone. The uploads path moves in every form, and only in the site's own references.</li>\n<li>A read-only scan after the URL change reports what still holds the old host, in the closing lines and the JSON <code>run</code> record (<code>url_leftovers</code>).</li>\n<li><code>--uid-columns</code> remaps plugin table columns of user ids. Comment authors are remapped by default, <code>_customer_user</code> wherever the key exists, and a user id of 0 means no user. Each remap is one statement per target, compares values exactly and refuses a column too narrow for the new ids; a bad id map is refused before anything runs.</li>\Line truncated
"changelog": "<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, still travels.</li>\n</ul>\n<p><strong>0.5.1</strong></p>\n<ul>\n<li>Breaking: <code>export all</code> needs its <code>&lt;zip&gt;</code>, <code>export users</code> its <code>&lt;file&gt;</code> and <code>import users</code> its <code>--map-file</code>; none has a default in the working directory any more, and an empty path is refused.</li>\n<li>Breaking: <code>--new-url</code> and <code>--old-url</code> must start with <code>http://</code> or <code>https://</code> and a valid host, and may not hold <code>%</code>. A URL change whose new address is the old one plus a path is refused unless you pass <code>--dangerously-allow-nested-url</code>.</li>\n<li>Breaking: every file that carries user data (the package, the users file, a dump, the id map, the backup) is refused in a directory another user could replace it in. A missing directory for one is created owner-only.</li>\n<li>Breaking: an import over an existing site takes the source's role definitions for every role the source defines, exactly as exported, and keeps the roles only the site defines; <code>--role-definitions=destination</code> keeps the site's definitions, as before. The plan, the closing lines and the JSON <code>run</code> record (<code>role_definitions</code>) list, per role, the capabilities added and removed.</li>\n<li>Breaking: <code>import all</code> refuses a package upload already on the site with other content, naming it, unless you pass <code>--upload-collisions=keep</code> or <code>--upload-collisions=replace</code>. One with the same content is skipped. <code>replace</code> moves the site's file into <code>--backup-dir</code> first, which it needs; the undo lines put it back. The plan and the JSON <code>run</code> record (<code>upload_collisions</code>) count them.</li>\n<li>Breaking: <code>import all</code> with <code>--plugins</code> or <code>--themes</code> refuses a plugin or theme installed at another version than the package's copy, older or newer, naming both versions, unless you pass <code>--installed-versions=keep</code> or <code>--installed-versions=replace</code>. <code>replace</code> moves the installed copy into <code>--backup-dir</code> first, before anything else runs; the undo lines put it back and say to reset PHP's opcode cache. Replacing code another site of the network runs needs <code>--dangerously-allow-shared-code-replace</code>, and the refusal names those sites. The plan and the JSON <code>run</code> record (<code>installed_versions</code>) list each difference. After a replace, a live run says to reset PHP's opcode cache, in its closing lines or, under <code>--format=json</code>, as the <code>run</code> record's <code>reset_opcode_cache</code>.</li>\n<li>The plugin and theme moves come before the site is created, the backup, the import and the URL passes, so no search-replace child loads the code being replaced. A move no longer predicts a rename from device numbers: two mounts of one filesystem failed it after the import. It renames a probe file first, once per move, and copies, verified, where the probe did not keep its inode. Copies keep their modification times.</li>\n<li>Nested mounts are not supported: read from <code>/proc/self/mountinfo</code>, a mount point inside the uploads, plugin or theme tree a move places files in, or in installed code <code>--installed-versions=replace</code> would move away (a single-file plugin mounted on its own included), refuses the run while the plan is built, naming the mount point, and agLine truncated
}
}