Bug
The wp mu-migration export and wp mu-migration import WP-CLI commands are not registered, so users cannot export/import via the CLI:
$ wp mu-migration export all /tmp/export.zip --blog_id=2 --url=http://wordpress.local:8080
Error: 'mu-migration' is not a registered wp command.
Root Cause
WP-CLI command registration happens at the bottom of each mu-migration class file (e.g., \WP_CLI::add_command('mu-migration export', ...) at the end of class-mu-migration-export.php). These files are only loaded via Site_Exporter::load_dependencies(), which is gated behind the non-existent vendor/autoload.php check (see #1004).
Even if #1004 is fixed, the command registration lines execute at file-include time, which only happens when handle_site_export() or handle_site_import() is called — too late for WP-CLI's command discovery.
Expected
Users should be able to run:
wp mu-migration export all /tmp/export.zip --blog_id=2
wp mu-migration import all /tmp/export.zip --new_url=http://newsite.example.com
Or ideally, proper Ultimate Multisite CLI commands:
wp wu export-site 2 /tmp/export.zip --uploads --themes --plugins
wp wu import-site /tmp/export.zip --new-url=http://newsite.example.com
Suggested Fix
- Register the mu-migration dependencies and CLI commands early in the plugin lifecycle (in
init() or load_extra_components()) so WP-CLI discovers them at boot time
- Consider adding proper
wp wu export-site and wp wu import-site commands as wrappers that call the underlying mu-migration commands — consistent with the wu_ namespace convention
Files to modify
EDIT: inc/class-wp-ultimo.php or inc/site-exporter/class-site-exporter.php — load mu-migration commands during plugin init when WP-CLI is active
NEW: inc/apis/class-cli-export-import.php (optional) — proper wp wu export-site / wp wu import-site wrappers
Severity
High — CLI export/import is completely non-functional.
aidevops.sh v3.13.11 plugin for OpenCode v1.3.17 with claude-opus-4-6 spent 5m and 12,337 tokens on this as a headless worker.
Bug
The
wp mu-migration exportandwp mu-migration importWP-CLI commands are not registered, so users cannot export/import via the CLI:Root Cause
WP-CLI command registration happens at the bottom of each mu-migration class file (e.g.,
\WP_CLI::add_command('mu-migration export', ...)at the end ofclass-mu-migration-export.php). These files are only loaded viaSite_Exporter::load_dependencies(), which is gated behind the non-existentvendor/autoload.phpcheck (see #1004).Even if #1004 is fixed, the command registration lines execute at file-include time, which only happens when
handle_site_export()orhandle_site_import()is called — too late for WP-CLI's command discovery.Expected
Users should be able to run:
wp mu-migration export all /tmp/export.zip --blog_id=2 wp mu-migration import all /tmp/export.zip --new_url=http://newsite.example.comOr ideally, proper Ultimate Multisite CLI commands:
Suggested Fix
init()orload_extra_components()) so WP-CLI discovers them at boot timewp wu export-siteandwp wu import-sitecommands as wrappers that call the underlying mu-migration commands — consistent with thewu_namespace conventionFiles to modify
EDIT: inc/class-wp-ultimo.phporinc/site-exporter/class-site-exporter.php— load mu-migration commands during plugin init when WP-CLI is activeNEW: inc/apis/class-cli-export-import.php(optional) — properwp wu export-site/wp wu import-sitewrappersSeverity
High — CLI export/import is completely non-functional.
aidevops.sh v3.13.11 plugin for OpenCode v1.3.17 with claude-opus-4-6 spent 5m and 12,337 tokens on this as a headless worker.