Local Migrator has two parts:
- A WordPress plugin (
plugin/local-migrator.php) that exposes authenticated REST endpoints. - A CLI (
lm), packaged aslocal-migrator.phar, that connects to the plugin and downloads the site (files + database) efficiently.
You install the plugin on a site, copy the command it shows you, and run that command locally.
- Download the latest
local-migrator-plugin.zipfrom the releases page. - Install and activate the plugin in WordPress.
Run this installer (macOS/Linux) to place the CLI at /usr/local/bin/lm.
curl -sSL https://github.com/joeguilmette/local-migrator-poc/releases/latest/download/local-migrator.phar \
-o /tmp/local-migrator.phar && \
chmod +x /tmp/local-migrator.phar && \
sudo mv /tmp/local-migrator.phar /usr/local/bin/lm
lm --helpBasic command:
lm download --url=<URL> --key=<KEY> [--output=<DIR>] [--concurrency=<N>]--urlSite base URL (from the plugin page), e.g.https://example.com--keyAccess key (from the plugin page)--outputLocal destination directory (default:./local-backup)--concurrencyNumber of parallel file downloads (default:4)
Example:
lm download \
--url="https://example.com" \
--key="ACCESS_KEY_FROM_PLUGIN" \
--output="./example-backup"On success, Local Migrator will:
- Stream all
wp-content/files plus the database into a temporary workspace. - Build a single ZIP archive at
<output>/archives/<domain>-<YYYYmmdd-HHMMSS>.zip.- The archive contains
wp-content/(with the full tree) anddb.sqlat the root.
- The archive contains
- Remove the workspace and print the final archive path plus transfer stats.
Exit codes:
0– success2– bad or missing arguments3– HTTP / network error4– internal error
These steps are for contributors and release maintainers.
- PHP ^8.0 with the cURL and PHAR extensions
- Composer
- humbug/box listed in
cli/composer.json(as a dev dependency)
cd /path/to/local-migrator-poc/cli
composer install
vendor/bin/box compileThe build artifact is cli/dist/local-migrator.phar.
cd /path/to/local-migrator-poc/cli
sudo mkdir -p /usr/local/bin
sudo install -m 755 dist/local-migrator.phar /usr/local/bin/lm
lm --helpOr run directly without installing:
php dist/local-migrator.phar download --url=... --key=... --output=...Use the helper script (scripts/release.sh, requires the GitHub CLI with gh auth login):
./scripts/release.shThe script builds the plugin ZIP and PHAR, then creates or updates the GitHub release (attaching local-migrator-plugin-<version>.zip and cli/dist/local-migrator.phar). It also installs the freshly built PHAR locally.
-
Remove the CLI:
sudo rm /usr/local/bin/lm
-
Remove the plugin:
- Deactivate it from the WordPress Plugins screen.
- Delete
wp-content/plugins/local-migrator/.