Quick Answer: To migrate large WordPress websites (over 10GB) without HTTP 504 timeouts, bypass web plugins entirely and use terminal tools: 1) Perform an initial background file sync with rsync -avzP --exclude 'wp-content/cache' /var/www/html/ user@newserver:/var/www/html/, 2) Export the database using mysqldump --single-transaction --quick, 3) Stream the SQL dump directly over SSH, and 4) Run a final 30-second delta rsync pass before DNS cutover.
Why Standard Migration Plugins Crash on Sites Over 10GB
When a WordPress site contains over 100,000 media files in wp-content/uploads/ and a multi-gigabyte database, creating a single ZIP or TAR archive exceeds PHP memory limits and exhausts disk space (requiring 2x the site size in free space). HTTP upload requests timeout at 30 to 60 seconds.
Using rsync delta-transfers and streamed MySQL pipelines allows you to migrate 50GB to 500GB production stores with less than 60 seconds of final maintenance window.
Phase 1: Initial Baseline File Sync (While Site is Live)
Run the baseline rsync while your source site continues processing traffic normally:
# Baseline rsync transfer rsync -avzP --delete --exclude 'wp-content/cache' --exclude 'wp-content/upgrade' /home/sourceuser/public_html/ root@new-server-ip:/home/targetuser/public_html/
Phase 2: Live Database Export & SSH Pipeline Streaming
Stream the database directly from source server to target server memory without saving intermediate disk files:
mysqldump -u root -p'SourcePass' --single-transaction --quick --max_allowed_packet=512M source_dbname | gzip | ssh root@new-server-ip "gunzip | mysql -u root -p'TargetPass' target_dbname"
Phase 3: Final 30-Second Delta Sync & DNS Cutover
Put your source site into temporary read-only mode, run the final rsync pass (which only copies new media uploaded since the baseline pass in seconds), and update your DNS A records:
# Final 30-second delta sync rsync -avzP --delete /home/sourceuser/public_html/ root@new-server-ip:/home/targetuser/public_html/
🔗 Recommended Related Technical Guides:
Tuning Rsync Bandwidth Limits and SSH Ciphers for High-Speed Transfers
When syncing 50GB+ across cloud VPS servers, encrypting data with heavy default ciphers (like AES-256-GCM) can bottleneck CPU throughput. Speed up network transfers by specifying the lightweight chacha20-poly1305 cipher:
# High-throughput rsync transfer rsync -avzP -e "ssh -c [email protected] -p 22" --exclude 'wp-content/cache' /var/www/html/ root@new-server-ip:/var/www/html/
Handling Large Database Table Partitioning (wp_postmeta & wp_posts)
On enterprise databases where wp_postmeta exceeds 5 million rows, export tables individually to optimize system memory buffers:
# Export structure first mysqldump -u root -p --no-data dbname > db_structure.sql # Export data with extended inserts mysqldump -u root -p --no-create-info --quick --extended-insert dbname > db_data.sql
Enterprise Command-Line Migration Protocol (Step-by-Step)
# 1. Establish SSH Key Authentication between servers ssh-copy-id -i ~/.ssh/id_rsa.pub root@new-server-ip # 2. Baseline Rsync Sync (Non-Blocking) rsync -avzP --exclude 'wp-content/cache' /var/www/html/ root@new-server-ip:/var/www/html/ # 3. Stream MySQL Snapshot Dump directly over SSH Socket mysqldump -u root -p'SourcePass' --single-transaction --quick --routines --triggers dbname | gzip -1 | ssh -c [email protected] root@new-server-ip "gunzip | mysql -u root -p'TargetPass' target_dbname" # 4. Final Delta Sync Pass (30 Seconds) rsync -avzP --delete --exclude 'wp-content/cache' /var/www/html/ root@new-server-ip:/var/www/html/ # 5. Fix POSIX Permissions on Target Server ssh root@new-server-ip "chown -R www-data:www-data /var/www/html && find /var/www/html -type d -exec chmod 755 {} \; && find /var/www/html -type f -exec chmod 644 {} \;"
Handling WooCommerce Active Orders and Session State
To ensure zero lost customer orders during migration, temporarily enable maintenance mode on the checkout page for 60 seconds while the database snapshot is streamed. Once the new server receives the final SQL dump, update your Cloudflare DNS IP to cut over traffic instantly.
Host High-Traffic WordPress on CpanelFree
Deploy large websites with unmetered NVMe SSD storage, cPanel control, and LiteSpeed caching at 100% zero cost on CpanelFree.
Frequently Asked Questions
What happens if the rsync process disconnects halfway through?
The -P (partial and progress) flag allows rsync to resume exactly where it was interrupted without re-downloading previously transferred files.
Managing InnoDB Buffer Pool and Memory During Multi-Gigabyte Imports
When importing massive 10GB+ databases via command line, temporarily adjust MySQL server variables to accelerate transaction commit throughput:
# Pre-import MySQL performance optimization SET autocommit=0; SET unique_checks=0; SET foreign_key_checks=0; # Import SQL dump SOURCE /var/backups/dump.sql; # Re-enable consistency checks COMMIT; SET unique_checks=1; SET foreign_key_checks=1;
Why is mysqldump faster than phpMyAdmin for big databases?
mysqldump runs directly in the Linux shell as a compiled C binary with direct socket access, bypassing PHP memory limits, web server request timeouts, and browser upload constraints completely.
Automating Large Site Migrations with Screen / Tmux Background Sessions
When running multi-hour rsync transfers or large SQL restores, a dropped SSH connection can terminate the process. Always launch a tmux or screen session before starting:
# Start persistent tmux session tmux new -s migration_session # Re-attach anytime if SSH disconnects tmux attach -t migration_session
Pro Sysadmin Tip: Optimizing Network MTU for Jumbo Frames
If migrating between VPS instances within the same cloud data center (private network), enabling Jumbo Frames (MTU=9000) increases rsync throughput by up to 25% by reducing packet header overhead.
Executing terminal-based rsync and streamed MySQL dumps ensures enterprise-grade data consistency and zero timeout errors regardless of site size.

