<- All articles
Hosting
Migrate a WordPress via FTP with the CLI
Step by step: YAML config file, migrate command, and what happens under the hood at each step.
What You Need
- FTP access for both the source and destination.
- An empty MySQL database created on the destination side (via cPanel).
python3andpipon your machine (or a VPS).
No SSH access is required: a PHP agent is deployed via FTP, executed via HTTP, and then automatically deleted.
1. Install the CLI
$ unzip wp-migrate-toolkit-cli.zip && cd wp-migrate-toolkit-cli/cli $ pip install -r requirements.txt $ cp example.config.yml mysite.yml
2. Fill in the Config
Open mysite.yml and specify the source, destination, and target database (host, user, password, wp_path, site_url, and the destination database).
On shared hosting, set tls: false (plain FTP) if FTPS fails, or tls: true + verify_cert: false to ignore an invalid certificate.
3. Verify, then Migrate
$ python3 wpmig.py migrate -c mysite.yml [1/2] SOURCE - export OK database exported: 77 tables OK files archived (zip): 12,776 files [2/2] DESTINATION - import OK extraction: 12,776 files, 0 errors OK database imported: 77 tables OK search-replace: 282 lines OK Completed in 92 s.
What Happens Under the Hood
- Source: the agent dumps the database in streaming and zips the site (or a .tar if ZipArchive is missing), then the CLI downloads both artifacts.
- Destination: FTP upload, on-site extraction,
wp-config.phpupdate, then.sqlimport. - Finalization: serialization-safe URL replacement, and deletion of the agent and temporary files on both sides.
Migrate a WordPress site hassle-free
WP Migrate Toolkit moves files + database over FTP, without SSH.
Download the CLI Download the plugin