WP-CLI
WP-CLI reference (Pro)
Automate backups, restores, imports, installer deploy, disaster recovery, and staging from the shell. Full parity with the Multisite Migrate admin UI — Pro license required for every command except help.
Requirements
- WP-CLI installed on the server (or SSH session).
- Multisite Migrate plugin active; run commands from the WordPress root (
wpmust load the site). - Pro license — every command except
helprequires Multisite Migrate Pro. Plus and Free licenses cannot use WP-CLI. - WordPress capability:
manage_options(single site) ormanage_network(multisite network tasks).
Getting started
wp multisite-migrate help
wp multisite-migrate help --topic=restore
wp multisite-migrate backup --help
wp multisite-migrate list help prints a full command tree, capability notes, and copy-paste examples. Use --topic=backup|restore|import|jobs|installer|recovery|staging|caps to filter sections. Per-command flags are documented with native WP-CLI --help.
Command tree
| Command | Purpose |
|---|---|
backup | Run a backup job (local and optional cloud upload) |
restore <job-id> | Same-server restore or URL migration with topology options |
import | Register archive from disk, URL, or cloud; optional chained restore |
list | List completed backup or restore jobs |
status <job-id> | Job progress, percent, and metadata |
cancel <job-id> | Cancel a running job |
delete <job-id> | Delete job record and local archive when present |
prefetch <job-id> | Download cloud-only backup before restore |
manifest <job-id> | Print archive manifest JSON |
migration-preview <job-id> | Preview URL and table mapping for migration |
info | Plugin version, engine, and license summary |
health | PHP extensions, disk space, storage paths |
cleanup | Remove temporary import and worker files |
prune | Apply retention policy to old local backups |
installer | Deploy installer beside a backup or download bootstrap PHP |
recovery | Set, launch, or reset disaster recovery point |
list-remote <channel> | List remote backups (gdrive, s3, sftp, dropbox) |
staging | Create, delete, or push to a staging subsite |
help | Print this reference in the terminal |
Backup
wp multisite-migrate backup
wp multisite-migrate backup --upload --destination=gdrive
wp multisite-migrate backup --scope=network --profile=full
wp multisite-migrate backup --scope=subsite --profile=db --incremental Common flags: --upload, --destination=local|gdrive|s3|sftp|ftp|dropbox, --scope=network|subsite, --profile=full|db|files|media|plugins|themes|custom, --incremental, --quiet.
Cloud upload requires Plus/Pro cloud storage configured in Cloud Storage. Network scope requires Pro (CAP_MULTISITE).
Restore
wp multisite-migrate restore 42 --yes
wp multisite-migrate restore 42 --mode=db --no-safety-snapshot
wp multisite-migrate restore 42 --migration --old-url=https://old.example --new-url=https://new.example --yes Topology flags mirror Advanced restore in the admin UI:
--topology-import=subsite_on_network+--topology-target-url=…— subsite backup onto an existing network--topology-import=network_to_subsite+--topology-target-blog-id=…— network backup into a subsite slot--prefix-policy=keep_source|remap_wp,--blog-domains=<json>,--passphrase=…for.venc
Long restores show a progress bar. Safety snapshot runs unless --no-safety-snapshot. Use --yes to skip overwrite confirmation.
Import
wp multisite-migrate import /var/backups/site.zip
wp multisite-migrate import --url=https://cdn.example/backup.zip
wp multisite-migrate import --from=gdrive --remote-id=FILE_ID --name=site.zip
wp multisite-migrate import /path/archive.zip --restore --via-worker --yes Remote URL and cloud channels require Pro (CAP_REMOTE_IMPORT). Chain --restore to start restore immediately; add --via-worker for in-plugin restore instead of installer deploy.
Job management
wp multisite-migrate list --type=backup --format=table --limit=50
wp multisite-migrate status 42
wp multisite-migrate cancel 42
wp multisite-migrate delete 42
wp multisite-migrate manifest 42
wp multisite-migrate migration-preview 42 list supports --format=table|json|csv. Subsite admins on multisite see only their scope unless they have network cap.
Installer & empty server
wp multisite-migrate installer 42
wp multisite-migrate installer 42 --bridge
wp multisite-migrate installer download --type=php
wp multisite-migrate installer download 42 --type=php Deploys the same wizard as Import → Open installer. --bridge uses wp-admin MU-plugin proxy when archives are protected. download writes bootstrap PHP beside your shell (Pro CAP_INSTALLER).
See also Empty-server migration.
Disaster recovery
wp multisite-migrate recovery set --job-id=42
wp multisite-migrate recovery status
wp multisite-migrate recovery launch
wp multisite-migrate recovery reset Matches Backups → Recovery: in-place overwrite from a pinned full backup with WordPress core. Disable site-wide with define('MM_DISALLOW_RECOVERY', true); in wp-config.php.
Staging
wp multisite-migrate staging create --slug=staging --title="Staging"
wp multisite-migrate staging delete --slug=staging
wp multisite-migrate staging push --job-id=42 Requires Pro CAP_STAGING. Same flows as Staging in the restore guide.
Maintenance
wp multisite-migrate info
wp multisite-migrate health
wp multisite-migrate cleanup
wp multisite-migrate prune
wp multisite-migrate list-remote gdrive License capabilities
After the Pro gate, individual commands may require secondary capabilities (same as the admin UI):
| Capability | CLI examples |
|---|---|
CAP_CLI | All commands except help — Pro only |
CAP_CLOUD | backup --upload, prefetch, list-remote |
CAP_REMOTE_IMPORT | import --url, import --from=* |
CAP_MULTISITE | backup|restore --scope=network |
CAP_INSTALLER | installer download |
CAP_STAGING | staging * |
Scenario recipes
| Scenario | Commands |
|---|---|
| Subsite → standalone migration | wp multisite-migrate restore <id> --migration --old-url=… --new-url=… --yes |
| Subsite → existing network | wp multisite-migrate restore <id> --topology-import=subsite_on_network --topology-target-url=… --yes |
| Network → subsite slot | wp multisite-migrate restore <id> --topology-import=network_to_subsite --topology-target-blog-id=… --yes |
| Import then installer | wp multisite-migrate import /path/backup.zip --restore |
| Import then in-plugin restore | wp multisite-migrate import /path/backup.zip --restore --via-worker --yes |
| Cloud-only backup → restore | wp multisite-migrate prefetch <id> then wp multisite-migrate restore <id> --yes |
| Deploy installer (bridge) | wp multisite-migrate installer <id> --bridge |
| Disaster recovery point | wp multisite-migrate recovery set --job-id=<id> then recovery launch |
Global flags
--quiet— suppress progress messages on long jobs--porcelain— machine-readable progress lines
Related guides
WP-CLI FAQ
Shell automation requires Pro. Use help on the server for the live command list.
Which license do I need for WP-CLI?
Pro. Free and Plus cannot run Multisite Migrate WP-CLI commands (except viewing help where available).
Where should I run wp commands?
From the WordPress root so WP-CLI loads the site. The Multisite Migrate plugin must be active.
Can I automate schedules via CLI?
Yes on Pro — backup, restore, import, installer, recovery, and staging commands mirror the admin UI. See the recipes section above.
Does the 14-day money-back apply if I only use WP-CLI?
Yes. New Plus or Pro purchases include a 14-day money-back guarantee regardless of whether you prefer admin UI or WP-CLI.