Site Migration
Migrate your WordPress site to a new host with SafeLink encrypted transfer, cloud relay, and portable installer.
Overview
SafeGuard includes a built-in migration tool that moves your entire WordPress site — database, files, plugins, themes, and uploads — to a new host. No intermediate downloads, no FTP juggling.
The transfer uses SafeLink, an ECDH-encrypted protocol that streams data directly from source to destination. Both sites negotiate a shared secret using Elliptic Curve Diffie-Hellman key exchange, so the migration payload is encrypted end-to-end even over plain HTTP.
There are three ways to migrate:
| Method | When to use |
|---|---|
| SafeLink | Both sites have SafeGuard installed. The fastest and simplest option. |
| Cloud Relay | Destination is behind a firewall or NAT. SafeLink falls back to this automatically. |
| Portable Installer | Destination does not have WordPress or SafeGuard installed yet. |
SafeLink Migration
This is the standard migration path when SafeGuard is installed on both sites.
Generate a migration code on the destination
On the destination site (the new host), go to SafeGuard → Migrate → Receive and click Generate Code. This produces a one-time migration code.
Copy the migration code
Copy the code to your clipboard. The code is valid for 15 minutes and can only be used once.
The migration code contains the destination URL and a one-time encryption token. Do not share it publicly.
Paste the code on the source site
On the source site (the old host), go to SafeGuard → Migrate → Send and paste the migration code into the input field.
Start the migration
Click Start Migration. SafeGuard runs preflight checks on both sites, then begins streaming data. The UI displays a 5-phase progress stepper — Handshake → Manifest → Files → Database → Complete — so you always know exactly where the migration stands.
You can safely close your browser during migration. The transfer continues in the background. When you return, the UI automatically reconnects and picks up where it left off.
If you need to stop, clicking Cancel prompts a confirmation dialog before aborting the migration.
Verify the destination
Once the migration completes, visit the destination site and confirm everything works:
- Pages and posts render correctly
- The admin dashboard loads without errors
- Plugins are active and functioning
- Media files display properly
- Permalinks work (you may need to flush them under Settings → Permalinks → Save Changes)
SafeGuard automatically replaces URLs in the database during migration. If you use hardcoded URLs in theme files or custom code, you will need to update those manually.
Incremental transfers — During the manifest phase, SafeGuard compares the source and destination file lists and only transfers files that are new or changed. If you are re-running a migration (for example, after a partial failure), previously transferred files are skipped, which significantly reduces transfer time for large sites.
Preflight Checks
Before the transfer begins, SafeGuard runs automated preflight checks on both sites:
| Check | What it verifies |
|---|---|
| WP version | Both sites meet the minimum WordPress version requirement |
| PHP version | Destination PHP version can run the source site's plugins and themes |
| Disk space | Destination has enough free disk space for the full site |
| SSL | Both sites use matching protocols (HTTP or HTTPS) to avoid mixed-content issues |
| Theme compatibility | Active theme exists and is compatible with the destination environment |
| PHP extensions | Required extensions (zip, curl, mbstring) are available on the destination |
Preflight issues are reported as either errors (which block migration) or warnings (which you can acknowledge and proceed). For example, a PHP version mismatch is an error, while a minor WordPress version difference is a warning.
Cloud Relay
If the destination site cannot accept incoming connections — for example, it is behind a corporate firewall, a NAT router, or the hosting provider blocks inbound requests — SafeGuard automatically falls back to Cloud Relay.
Cloud Relay routes the encrypted migration stream through SafeGuard's relay server. The data remains end-to-end encrypted with the same ECDH keys; the relay server cannot read it.
There is nothing to configure. SafeGuard detects the connectivity issue during preflight and activates Cloud Relay transparently. You will see a notice in the migration UI indicating relay mode is active.
Cloud Relay is slightly slower than direct SafeLink because data passes through an intermediate server. For large sites (10 GB+), prefer a host that allows direct connections when possible.
Portable Installer
Use the Portable Installer when the destination server does not have WordPress or SafeGuard installed — for example, a fresh VPS, a blank shared hosting account, or a staging environment you are setting up from scratch.
Generate the installer package
On the source site, go to SafeGuard → Migrate → Package and click Generate Installer. SafeGuard creates two files:
installer.php— a self-contained PHP script that handles extraction and setupsafeguard-archive.zip— the complete site archive (database + files)
Upload to the destination server
Upload both files to the web root of the destination server (e.g., /var/www/html/ or public_html/) using FTP, SFTP, or your hosting file manager.
Run the installer
Open https://your-new-domain.com/installer.php in a browser. The installer walks you through:
- Database credentials for the new host
- URL replacement (old domain → new domain)
- Extraction and installation
Once complete, the installer deletes itself for security.
If the installer does not delete itself automatically, remove installer.php and safeguard-archive.zip from your server manually. Leaving them accessible is a security risk.
CLI Commands
You can run migrations entirely from the command line using WP-CLI.
# Generate a migration code on the destination site
wp safeguard migrate receiveThis outputs a migration code to stdout. Copy it and use it on the source site.
# Start a migration using the code from the destination
wp safeguard migrate start <code>
# Check migration progress
wp safeguard migrate status
# Cancel a migration in progress
wp safeguard migrate cancelThe CLI is useful for migrating sites via SSH, scripting batch migrations, or working with headless WordPress installs that do not have browser access.
Troubleshooting
Connection timeout during migration — Large sites may hit PHP's max_execution_time limit. Increase it to at least 300 seconds in your php.ini or .htaccess:
max_execution_time = 300Alternatively, use WP-CLI which bypasses the web server timeout entirely.
Memory limit exhausted — If the migration fails with a memory error, increase PHP's memory limit:
memory_limit = 512MOr in wp-config.php:
define('WP_MEMORY_LIMIT', '512M');SSL mismatch error — This occurs when one site uses HTTPS and the other uses HTTP. Either install an SSL certificate on the HTTP site, or temporarily switch the HTTPS site to HTTP during migration. SafeLink encryption protects the data regardless of the transport protocol.
Migration stalls at "Uploading media" — This usually means the destination server has a low upload_max_filesize or post_max_size. SafeGuard streams in chunks, but very restrictive limits (under 2 MB) can cause issues. Set both to at least 64 MB.
If you continue to have issues, enable debug logging under SafeGuard → Settings → Advanced and check the log at wp-content/safeguard/logs/migration.log for detailed error messages.