=== MU Migration ===
Contributors: mmulligan
Tags: multisite, migration, wp-cli, export, import
Requires at least: 6.1
Tested up to: 7.0
Requires PHP: 8.1
Stable tag: 0.4.0
License: MIT
License URI: https://opensource.org/licenses/MIT

WP-CLI commands to export a single WordPress site into a package and import it into a multisite network, or the reverse. Maintained fork of 10up's archived MU-Migration.

== 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.

**Commands**

* `wp 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 ==

1. Upload the plugin to `wp-content/plugins/` and activate it. On multisite, network activate it so the command is available for every site.
2. Install it on both the site you are moving and the network you are moving it to.
3. Run `wp mu-migration info` to confirm the command is registered.

Updates are delivered through the `Update URI` header and the Manifest Updater plugin.

== Changelog ==

= 0.4.0 =
* Forked from 10up/MU-Migration at its final commit. Packaged as a WordPress plugin with self-hosted updates.
* 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.
* Fixed site creation reporting id 0 for every new site.
* PHP floor raised from 7.1 to 8.1. Runtime Composer dependencies removed.
* Dead code and the retired Travis configuration removed.
