diff --git a/mu-migration.json b/mu-migration.json index f49954e..ece7bdd 100644 --- a/mu-migration.json +++ b/mu-migration.json @@ -1,13 +1,13 @@ { "name": "MU Migration", "slug": "mu-migration", - "version": "0.4.0", - "download_url": "https://gitea.mulligan.casa/wordpress/wp-updates/raw/branch/main/mu-migration/mu-migration-0.4.0.zip", + "version": "0.5.0", + "download_url": "https://gitea.mulligan.casa/wordpress/wp-updates/raw/branch/main/mu-migration/mu-migration-0.5.0.zip", "homepage": "https://gitea.mulligan.casa/wordpress/mu-migration", "requires": "6.1", "tested": "7.0", "requires_php": "8.1", - "last_updated": "2026-09-16 21:37:57", + "last_updated": "2026-09-30 18:27:16", "author": "Mike Mulligan", "author_homepage": "https://gitea.mulligan.casa/mmulligan", "tags": [ @@ -18,8 +18,8 @@ "import" ], "sections": { - "description": "
MU Migration adds a wp mu-migration 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. On import it rewrites the table prefix, remaps user ids into the network's shared users table, runs the URL search-replace, and performs the housekeeping a moved site needs.
This is a maintained fork of 10up's MU-Migration, which was archived on 2 March 2026. The fork runs on current PHP, ships as an ordinary plugin with self-hosted updates, and is being hardened so every destructive action is explicit, previewable with a dry run, and refused unless acknowledged.
\nCommands
\nwp mu-migration export all <zip> exports tables, users and optionally --plugins, --themes, --uploads.wp mu-migration export tables <file> and export users <file> export one piece at a time.wp mu-migration import all <zip> imports a package, creating a subsite or targeting an existing one with --blog_id.wp mu-migration import tables <file> and import users <file> import one piece at a time.wp mu-migration posts update_author <map> remaps post authorship to the new user ids.wp mu-migration users update_passwords resets or replaces passwords after a move.wp mu-migration info prints the tool's version.Full usage, including the safety flags as they land, is documented in the repository README.
", - "installation": "wp-content/plugins/ and activate it. On multisite, network activate it so the command is available for every site.wp mu-migration info to confirm the command is registered.Updates are delivered through the Update URI header and the Manifest Updater plugin.
0.4.0
\n* Forked from 10up/MU-Migration at its final commit. Packaged as a WordPress plugin with self-hosted updates.
\n* Runs on PHP 8.1 through 8.5: the abandoned zip library is replaced by PHP's ZipArchive, CSV calls pass the escape argument PHP 8.4 requires, and site creation uses wp_insert_site. Compatibility work by Brandon Kraft.
\n* Fixed site creation reporting id 0 for every new site.
\n* PHP floor raised from 7.1 to 8.1. Runtime Composer dependencies removed.
\n* Dead code and the retired Travis configuration removed.
MU Migration adds a wp mu-migration 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.
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.
\nCommands
\nwp mu-migration export all [<zip>] exports tables, users and meta data, plus --plugins, --themes and --uploads when asked.wp mu-migration export tables <file> and export users [<file>] export one piece at a time.--blog-id, or without it the site WP-CLI runs against (--url, or the main site).wp mu-migration import all <zip> imports a package: into a new subsite at --new-url (or the package's own address with --same-url), or over an existing site with --blog-id.wp mu-migration import tables <file> --blog-id=<id> and import users <file> --blog-id=<id> import one piece at a time.wp mu-migration posts update_author <map> --blog-id=<id> remaps post authorship to the new user ids.wp mu-migration users update_passwords sets or resets passwords after a move.wp mu-migration info prints the tool's version.Plan, refuse, confirm, apply
\nEvery 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 wp search-replace --dry-run --report so the plan carries real counts. The plan is printed before anything is applied.
--dry-run stops there and closes with Dry run: N steps planned; this tool wrote nothing outside its private work directory, which is removed when this run ends. 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 Cancelled 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.Continue?. --yes skips the question and acknowledges nothing.--quiet, or when standard input is not an interactive terminal. A live --format=json run needs --yes.Acknowledgement flags
\n--allow-main-site: any write to the network's main site (or the only site of a single-site install), and every network-wide plugin activation.--dangerously-allow-drop-tables: a dump that drops a table that exists now.--dangerously-allow-table-changes: a dump that changes an existing table in place (REPLACE, ALTER, or INSERT without recreating it).--dangerously-allow-global-tables: widening the search-replaces to the network's users, usermeta, blogs, site and sitemeta tables.--allow-overwrite: writing an output file over an existing one.--dangerously-allow-role-overwrite: replacing the role of an existing user who already has one on the target site.--allow-password-reset-mail: mailing password-reset links, the tool's only outbound network call.Two more flags request behaviour that is off by default, and the confirmation lists them: --dangerously-allow-guid-rewrite (search-replaces otherwise always skip the guid column) and --dangerously-allow-database-redirects (dumps with USE, database-qualified names or a REFERENCES into another database are otherwise refused; allowing them prints a DANGER warning even under --quiet, because such statements can write outside the backed-up database).
Every flag is bare: a value or a --no- negation is refused. Former spellings, such as --blog_id or --allow-drop-tables, are refused with the name that replaced them.
Safety behaviour
\n<backup-dir>/mu-migration-backup-blog<id>-<timestamp>.sql, an owner-only (0600) file in an owner-only (0700) directory. --backup-dir must be absolute and outside the WordPress root. This backup does not cover network tables, users and memberships, uploads, plugin and theme directories or redirected databases: take a full backup first.wp db import - on standard input, where the database client stops at the first statement that fails. The import fails, naming the error and its line, when the client exits non-zero or prints an ERROR line. wp db import <file> carries on past a failed statement and exits 0.IF NOT EXISTS and never drops, and a table it writes with INSERT DELAYED (whose rows the server queues), are named in the plan as not counted.--skip-columns=guid. The URL is matched only as a whole host and path.users.json, which carries every role a user holds on the exported site and every usermeta row that travels, byte for byte. Session tokens and application passwords never travel; the per-site keys WordPress itself writes are moved to the target site's prefix, and every other key keeps its name. A users.csv from a version before 0.5.0 is refused: re-export it.added_user_meta or updated_user_meta hook fires for them; the plugin's own user-data hooks still run. A value the database column cannot hold stops the run, naming the user, the key and the row; on a usermeta table that keeps no transactions (MyISAM), it also names the rows already written.--plugins and --themes, never over an installed copy. Uploads are merged without replacing existing files.--format=json prints JSON Lines: a step record per step, a summary, a refused record when an acknowledgement is missing, and a final run record with the outcome, the backup path and any recovery lines. A step record is printed before anything is applied, so its performed is true only for what the plan build itself did; the live outcome is the run record.Recovery after a failure is printed guidance, never executed. Its restore of the backup is wp db import - < '<backup>', run from a shell, so the restore also stops at the first statement that fails. A failed filesystem step names its cause (a missing file, a directory the tool cannot write) without a PHP warning printed above it. Full usage is documented in the repository README.
wp-content/plugins/ and activate it. On multisite, network activate it so the command is available for every site.wp mu-migration info to confirm the command is registered.Requires PHP 8.1 or newer with the zip extension, WordPress 6.1 or newer, and WP-CLI with a mysql or mariadb client that can log in to the database server: the import, the backup and the export run WP-CLI's wp db commands. The MariaDB 11.8 client in the official WP-CLI Docker image cannot load caching_sha2_password, MySQL 8's default; against such a server, use a mysql_native_password database user or a MySQL client. There are no runtime Composer dependencies.
Updates are delivered through the Update URI header and the Manifest Updater plugin.
0.5.0
\n* Breaking: users travel in users.json (format 2) instead of users.csv. A users.csv, or a package from before 0.5.0, is refused: re-export it with this version.
\n* Breaking: the mu_migration/export/user/headers filter is removed; what the mu_migration/export/user/data filter returns travels without it.
\n* Breaking: every option has one hyphenated spelling (--blog-id, --new-url, --old-url …); the underscore forms 0.4.0 took are refused, naming the new one. Flags take no value and cannot be negated.
\n* Breaking: import tables and import users require --blog-id; import all requires --new-url or --same-url; import tables requires --old-url with --new-url, or --same-url. Without --blog-id, the exports read the site WP-CLI runs against, not blog 1.
\n* Breaking: a live run that changes anything asks for confirmation (--yes skips it) and is refused when nobody could answer, and each dangerous effect needs its own acknowledgement flag (--allow-main-site, --dangerously-allow-drop-tables and the others listed above).
\n* Every run is planned first and the plan printed; --dry-run stops there. --format=json prints the plan and outcome as JSON Lines.
\n* An import backs up the target site's own tables first and, when a step fails, prints recovery commands. The dump is fed to the database client on standard input, so the first failed statement fails the import, and row counts are verified afterwards.
\n* The table prefix is rewritten in PHP on a copy of the dump, and every dump statement is held to a shape a dump tool writes. Network tables and other sites' tables are never exported, imported or search-replaced unless asked.
\n* Users keep every role and every usermeta row, byte for byte, plus capabilities granted outside a role. Application passwords no longer travel. An existing user's role is kept unless you pass --dangerously-allow-role-overwrite.
\n* Plugins and themes are installed only with --plugins and --themes, never over an installed copy; uploads are merged without replacing files.
\n* Many fixes: raw PHP warnings replaced by errors that name their cause, safer package and work-directory handling, and exact recovery lines. The full list is in the repository's CHANGELOG.md.
0.4.0
\n* Forked from 10up/MU-Migration at its final commit. Packaged as a WordPress plugin with self-hosted updates.
\n* Runs on PHP 8.1 through 8.5: the abandoned zip library is replaced by PHP's ZipArchive, CSV calls pass the escape argument PHP 8.4 requires, and site creation uses wp_insert_site. Compatibility work by Brandon Kraft.
\n* Fixed site creation reporting id 0 for every new site.
\n* PHP floor raised from 7.1 to 8.1. Runtime Composer dependencies removed.
\n* Dead code and the retired Travis configuration removed.