Copied to clipboard

WP-Migrate Documentation

A CLI tool for migrating WordPress sites between servers. Automatically detects SSH, SFTP, or FTP access and uses the fastest method available.

Installation

macOS & Linux

Run the installer script which automatically detects your system and downloads the correct binary:

bash
$ curl -fsSL https://wp-migrate.dev/install.sh | bash

This installs wp-migrate to /usr/local/bin (requires sudo).

Manual Installation

Download the appropriate binary for your platform from GitHub Releases:

Quick Start

Interactive Wizard

The easiest way to run a migration is with the interactive wizard:

bash
$ wp-migrate

The wizard will prompt you for source and destination credentials, then run the migration automatically.

Command-Line Mode

For automation or scripted migrations, create a YAML config file and run:

bash
$ wp-migrate --config migration.yaml

Licensing

WP-Migrate includes 3 free migrations to try the tool. After that, you'll need to purchase a license.

Activating a License

bash
$ wp-migrate activate YOUR-LICENSE-KEY

Deactivating a License

To move your license to a new machine:

bash
$ wp-migrate deactivate

Check License Status

bash
$ wp-migrate status
License Types

Single User ($39) - 2 machine activations, unlimited migrations.
Agency ($149) - Unlimited activations, unlimited migrations.

Configuration

Create a YAML configuration file for scripted or repeatable migrations:

yaml
# migration.yaml
source:
  ftp_host: ftp.oldsite.com
  ftp_user: oldsite_user
  ftp_pass: ${SOURCE_FTP_PASS}  # Environment variable
  wp_path: /public_html

destination:
  ftp_host: ftp.newsite.com
  ftp_user: newsite_user
  ftp_pass: ${DEST_FTP_PASS}
  wp_path: /public_html
  db_host: localhost
  db_name: newsite_wp
  db_user: newsite_dbuser
  db_pass: ${DEST_DB_PASS}
  new_url: https://newsite.com

Configuration Reference

Key Description Required
ftp_host FTP/SFTP server hostname Yes
ftp_user FTP/SFTP username Yes
ftp_pass FTP/SFTP password (supports env vars) Yes
ftp_port FTP/SFTP port (default: 21 for FTP, 22 for SFTP) No
wp_path Path to WordPress installation Yes
ssh_host SSH hostname (if different from FTP) No
ssh_user SSH username No
ssh_key Path to SSH private key No
db_host Database hostname Dest only
db_name Database name Dest only
db_user Database username Dest only
db_pass Database password Dest only
new_url New site URL for search-replace Dest only
server_ip Server IP for pre-DNS testing No
Security Tip

Never commit passwords to version control. Use environment variables like ${VAR_NAME} in your config file, then set them in your shell before running.

Commands

Command Description
wp-migrate Run interactive migration wizard
wp-migrate --config <file> Run migration from YAML config
wp-migrate activate <key> Activate license on this machine
wp-migrate deactivate Deactivate license from this machine
wp-migrate status Show license and migration status
wp-migrate version Show version information
wp-migrate help Show help message

Common Flags

Flag Description
--config, -c Path to YAML configuration file
--dry-run Show what would be done without making changes
--verbose, -v Enable verbose output
--skip-db Skip database migration (files only)
--skip-files Skip file migration (database only)
--force Overwrite existing files without prompting

Pre-DNS Testing

Test your migrated site before switching DNS by adding the server_ip option to your destination config:

yaml
destination:
  # ... other settings ...
  new_url: https://newsite.com
  server_ip: 192.168.1.100  # Destination server IP

After migration completes, add an entry to your local /etc/hosts file:

bash
192.168.1.100  newsite.com

Now you can visit https://newsite.com in your browser to test the migrated site on the new server before updating DNS.

How It Works

WP-Migrate automatically detects the best available method for each server:

1. Server Detection

When connecting to a server, WP-Migrate checks for:

2. File Transfer

3. Database Migration

4. URL Replacement

WP-Migrate performs serialization-aware search-replace:

Security

PHP Agent Security

When SSH is not available, WP-Migrate deploys a temporary PHP agent for database operations. The agent includes multiple security measures:

Credentials

Recommended Practices

Support

Need help? Here's how to get support:

Priority Support

Agency license holders receive priority email support with faster response times.