WPMove from the command line
Every Connector migration is also a WP-CLI command: export and import for free, pull, push and sync with Premium. Script it, schedule it, run it in your deployment pipeline.
What you can run
Nothing more to install: the commands come with the plugin, as soon as WP-CLI is available on the server.
Free — file export and import
wp wpmove export and wp wpmove import: the same JSON file as the admin screen, with the same pre-import report (--dry-run). No account, nothing leaves your server.
Premium — direct migration
wp wpmove pull, push and migrate <profile>: media, sync mode, specific items, menus and site settings, with the migration log in your terminal. Plus status, cancel and profiles.
Examples
Export and import a file (free)
On the source:
wp wpmove export content.json --types=post,page --taxonomies --user=admin
On the target, read the report first, then import — items are added, nothing is overwritten:
wp wpmove import content.json --dry-run --user=admin
wp wpmove import content.json --menus --user=admin
Run a saved profile (Premium)
Save a profile once in the connector screen: it keeps the other site, its application password (encrypted) and every option. Then, from the terminal:
wp wpmove profiles --user=admin
wp wpmove migrate "Production" --dry-run --user=admin
wp wpmove migrate "Production" --yes --user=admin
Any option overrides the profile for that run, for instance --sync or --types=page.
Pull a site without a profile (Premium)
The application password is read from the WPMVC_REMOTE_PASSWORD environment variable. Typed with read -s, it appears neither on screen nor in your shell history:
read -s WPMVC_REMOTE_PASSWORD && export WPMVC_REMOTE_PASSWORD
wp wpmove pull https://www.example.com --remote-user=admin --types=post,page --user=admin
Keep a staging site in sync every night (Premium)
Sync mode only carries what changed since the last successful migration to the same site. In the crontab of the site that drives the migration:
30 2 * * * cd /var/www/site && wp wpmove migrate "Staging" --sync --yes --quiet --user=admin
In a deployment pipeline (Premium)
Pass the secrets as variables of the pipeline, never in the command itself:
WPMVC_API_KEY="$WPMOVE_KEY" WPMVC_REMOTE_PASSWORD="$TARGET_APP_PASSWORD" \
wp wpmove push https://staging.example.com --remote-user=deploy --sync --yes --format=json --user=admin
The exit code says how it went: 0 success, 1 failure, 2 finished with some items in error. --format=json prints the counts for the pipeline to read.
Good to know
Run it as an administrator
Add --user=<admin>. Without an account, WordPress would strip iframes and scripts from your content and refuse to write menus and settings — the command stops before writing anything.
No password on the command line
It would end up in your shell history and in the process list. A saved profile (password stored encrypted) or the WPMVC_REMOTE_PASSWORD variable — nothing else is accepted. Same for the API key: saved once in the connector screen, or WPMVC_API_KEY.
One migration at a time
The command and the admin screen share the same run: the screen follows the command’s progress, and neither starts while the other is running. wp wpmove status tells you where it stands, wp wpmove cancel stops it.
Every option of the screen
--types, --status, --ids, --[no-]media, --replace, --replace-media, --taxonomies, --comments, --menus, --identity, --general, --sync, --dry-run. Details: wp help wpmove <command>.
Install the plugin, open a terminal.
Export and import are free on WordPress.org. Pull, push and sync come with every paid plan.