Website migration is a high-risk, high-impact operation that involves moving a website from one environment to another without breaking functionality, SEO rankings, or user experience.
A successful migration requires planning, validation, rollback strategy, and monitoring.
This guide covers multiple website migration techniques used by DevOps engineers, system administrators, and hosting providers for production websites.
Moving website to a new server or hosting provider
Migrating from shared hosting to VPS or cloud
Changing domain name
Switching control panels (cPanel → Plesk / DirectAdmin)
Migrating between Linux distributions
Re-architecting infrastructure (Monolith → Load-balanced setup)
Before starting any migration:
✔ Full website backup (files + database)
✔ DNS TTL reduced (300 seconds recommended)
✔ Disk space verified on destination
✔ PHP, database, and web server versions matched
✔ Maintenance window planned
✔ Rollback plan prepared
Large websites
Production servers
Minimal downtime requirements
A live e-commerce website cannot afford downtime during peak hours.
Initial sync (while site is live)
rsync -avz --progress /var/www/html/ root@newserver:/var/www/html/
Database dump
mysqldump -u dbuser -p dbname > db.sql
Transfer database
scp db.sql root@newserver:/root/
Import database on destination
mysql -u dbuser -p dbname < db.sql
Final sync during maintenance window
rsync -avz --delete /var/www/html/ root@newserver:/var/www/html/
Initial sync copies bulk data
Final sync captures recent changes
Downtime reduced to minutes
VPS or cloud environments
Entire server migration
Moving a production VPS from one data center to another.
Stop web services:
systemctl stop nginx apache2 php-fpm
Create disk snapshot (cloud-provider specific)
Restore snapshot on new instance
Update network configuration and IP
Start services:
systemctl start nginx apache2 php-fpm
Exact replica
No file-level inconsistencies
Very fast restore
Shared hosting
Managed servers
/scripts/pkgacct username
Transfer the backup:
scp /home/cpmove-username.tar.gz root@newserver:/home/
Restore on destination:
/scripts/restorepkg username
Handles emails, DNS, databases automatically
Minimal manual work
Large MySQL/PostgreSQL databases
Data-intensive applications
Lock tables (optional for consistency):
FLUSH TABLES WITH READ LOCK;
Dump database:
mysqldump --single-transaction --routines --triggers dbname > db.sql
Unlock tables:
UNLOCK TABLES;
Import on destination:
mysql dbname < db.sql
Database consistency is more critical than files for dynamic websites.
Zero-risk migration
SEO-critical websites
Modify local hosts file for testing:
192.168.1.100 example.com
Test website thoroughly on new server
Update DNS records after validation
No public impact during testing
Perfect for production validation
wp db export db.sql
wp search-replace 'oldsite.com' 'newsite.com'
php artisan config:clear
php artisan cache:clear
php artisan migrate
Frameworks store URLs, cache, and environment data internally.
Run these checks immediately:
Website loads correctly
Admin panel login works
Forms and payment gateways functional
Cron jobs running
SSL certificates installed
Email sending and receiving verified
✔ 301 redirects configured
✔ Canonical URLs verified
✔ Sitemap regenerated
✔ Google Search Console updated
✔ Noindex removed after testing
Always keep:
Old server intact for 48–72 hours
DNS rollback plan
Full backup ready for restore
Never migrate during peak traffic hours
Always test using hosts file
Log every step during migration
Monitor server logs after go-live
Keep DNS TTL low before migration
Zero or minimal downtime
No data loss
SEO rankings preserved
Faster troubleshooting
Predictable rollback