What to Consider When Migrating to Another Web Hosting Provider
Migrating a website to a new hosting provider is one of the highest-risk infrastructure operations a site owner can undertake. Done correctly, it results in zero data loss, negligible downtime, and measurably better performance. Done carelessly, it produces broken databases, DNS failures, SEO ranking drops, and hours of emergency recovery work.
This guide covers every critical phase of a hosting migration β from pre-migration auditing and compatibility validation, through DNS cutover mechanics, to post-migration monitoring β with the technical depth required to execute it without incident.
Phase 1: Audit Your Current Hosting Environment Before Touching Anything
The single most common migration failure stems from skipping a thorough audit of the existing environment. Before you evaluate a new provider, you need a precise inventory of what you are actually running.
Traffic and Resource Profiling
Pull at least 90 days of server resource data β not just pageview counts. The metrics that matter are:
- Peak concurrent connections β not average traffic, but the spike ceiling your server must handle
- Memory consumption per PHP worker or application process
- Disk I/O patterns β especially relevant if you run a database-heavy application like WooCommerce or a custom CRM
- Bandwidth utilization β monthly transfer totals versus your current plan's cap
If your current host provides cPanel or Plesk, this data is accessible under the resource usage or AWStats sections. On a Linux VPS, run the following to capture a baseline snapshot:
vmstat 1 10
iostat -x 1 5
free -m
df -hThis output tells you whether your bottleneck is CPU, RAM, or disk β which directly determines whether you need a larger shared plan, a VPS, or a Dedicated Server.
Software Stack Inventory
Document every component of your stack with exact version numbers:
- PHP version (e.g., 8.1, 8.2) and active extensions (
mbstring,curl,gd,imagick,redis) - MySQL or MariaDB version and storage engine (InnoDB vs. MyISAM matters for migration tooling)
- Web server software: Apache, Nginx, LiteSpeed, or a reverse-proxy combination
- Any compiled modules, custom
.htaccessrules, ornginx.conflocation blocks - Cron jobs β export these from
crontab -land document them separately - SSL certificate type and issuer (Let's Encrypt, commercial CA, wildcard)
Missing even one PHP extension on the destination server can silently break functionality that only surfaces under specific user actions β a bug that is notoriously difficult to trace post-migration.
Phase 2: Evaluate and Select the Right Hosting Tier
Choosing the wrong hosting tier is a structural mistake that forces a second migration within months. Map your audit findings to the correct infrastructure class.
Hosting Tier Comparison
| Criteria | Shared Hosting | VPS Hosting | Dedicated Server |
|---|---|---|---|
| β | β | β | β |
| Isolation | None β shared resources | Full OS-level isolation | Complete hardware isolation |
| CPU/RAM | Shared pool, throttled | Guaranteed allocation | Full hardware allocation |
| Root access | No | Yes | Yes |
| Custom software | Severely limited | Full control | Full control |
| Scalability | Vertical only, limited | Vertical + horizontal | Hardware upgrade required |
| Best for | Brochure sites, low traffic | Growing apps, e-commerce | High-traffic, compliance-heavy |
| Typical uptime SLA | 99.9% | 99.9%β99.99% | 99.99% |
| DDoS protection | Basic or none | Provider-dependent | Advanced, configurable |
Key decision rule: If your application requires a specific PHP-FPM pool configuration, Redis socket connections, custom Nginx rewrites, or any daemon process, shared hosting is architecturally incompatible. You need at minimum a VPS with root access.
For WordPress or Joomla sites with moderate traffic, a VPS with cPanel provides the familiar control panel interface while retaining the isolation and performance of a virtual machine.
Provider Evaluation Criteria
Beyond marketing claims, evaluate providers on these verifiable technical factors:
- Uptime SLA with financial penalty clauses β a 99.9% SLA without compensation is meaningless
- Data center tier rating (Tier III or Tier IV for production workloads)
- Network redundancy β BGP multi-homing, multiple upstream providers
- Storage type β NVMe SSD versus SATA SSD versus spinning disk (latency differences are significant)
- Backup policy β frequency, retention period, whether backups are stored off-site
- Support response time SLA β distinguish between first-response time and resolution time
Phase 3: Create and Verify a Complete Backup
No migration should begin without a verified, restorable backup. "Verified" means you have actually tested restoration β not just confirmed that a backup file exists.
What a Complete Backup Must Include
- Web root files β the entire document root, including hidden files like
.htaccessand.env - All databases β exported as
.sqldumps, not just a file copy of the database directory - Email data β if you use Email Hosting tied to your domain, export mailboxes before any DNS changes
- Cron jobs β
crontab -l > crontab_backup.txt - SSL certificates and private keys β if using a commercial certificate, export the full chain
- Server configuration files β
/etc/nginx/,/etc/apache2/,/etc/php/, custommy.cnfsettings
Performing a Database Export
For MySQL/MariaDB, use mysqldump with options that preserve full fidelity:
mysqldump
--single-transaction
--routines
--triggers
--events
--set-gtid-purged=OFF
-u root -p your_database_name > database_backup_$(date +%F).sqlThe --single-transaction flag is critical for InnoDB tables β it takes a consistent snapshot without locking tables, which means your live site continues serving requests during the dump.
Verifying Backup Integrity
# Check the SQL dump is not truncated
tail -5 database_backup_2024-01-15.sql
# Verify file count in web root backup
tar -tzf webroot_backup.tar.gz | wc -l
# Test restoration to a local or staging environment
mysql -u root -p test_restore_db < database_backup_2024-01-15.sqlA backup you have not tested restoring is not a backup β it is a false sense of security.
Phase 4: Validate Compatibility on the Destination Server
Before transferring production data, spin up the new environment and validate compatibility using a staging approach.
PHP Version and Extension Verification
# On the destination server
php -v
php -m | grep -E 'mbstring|curl|gd|imagick|redis|zip|intl|opcache'Compare this output against your inventory from Phase 1. Any missing extension must be installed before migration, not after.
Database Compatibility Check
If migrating from MySQL 5.7 to MySQL 8.0 (a common scenario), be aware of these breaking changes:
- The
utf8mb3charset is deprecated; columns may need explicit charset declarations
GROUP BY behavior changed β queries that worked in 5.7 may fail in 8.0 without ONLY_FULL_GROUP_BY mode adjustment
NO_ZERO_DATE is enabled by default in strict mode, which rejects date fields containing 0000-00-00Test your SQL dump against the destination MySQL version before cutting over production traffic.
Web Server Configuration Translation
If migrating from Apache to Nginx (a frequent scenario when moving to a performance-optimized VPS), your .htaccess rules do not automatically translate. Common conversions:
Apache .htaccess redirect:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]Nginx equivalent in server block:
server {
listen 80;
server_name example.com www.example.com;
return 301 https://$host$request_uri;
}Missing this translation is one of the most common causes of post-migration 404 errors and redirect loops.
Phase 5: Execute the Migration with Downtime Minimization
Choose the Migration Window Strategically
Analyze your Google Analytics or server logs to identify your lowest-traffic window β typically between 02:00 and 05:00 in the primary audience's timezone on a Tuesday or Wednesday. Avoid Fridays; if something goes wrong, your support options narrow significantly over the weekend.
The Staging-First Migration Workflow
- Point a subdomain to the new server (e.g.,
staging.example.com) using an A record, without touching the production DNS - Transfer all files and databases to the new server
- Update the application's database connection string to point to the new database
- Modify your local
/etc/hostsfile to resolve the production domain to the new server's IP β this lets you test the full production configuration without affecting live users:
# Add to /etc/hosts on your local machine
203.0.113.50 example.com www.example.com- Run a full functional test β every form, payment flow, login system, API endpoint, and media upload
- Run performance benchmarks using
ab(Apache Benchmark) orwrk:
ab -n 1000 -c 50 https://example.com/- Only after passing all tests, proceed to DNS cutover
SSL Certificate Configuration
Ensure your SSL certificate is installed and validated on the new server before DNS cutover. If using Let's Encrypt:
certbot --nginx -d example.com -d www.example.comIf using a commercial certificate from a provider like those available through SSL Certificates, install the full certificate chain (certificate + intermediate CA + root CA) to avoid chain validation errors on older clients.
Phase 6: DNS Cutover β The Most Technically Sensitive Step
DNS propagation is widely misunderstood. The 48-hour figure is a worst-case ceiling, not a typical duration. In practice, most resolvers respect the TTL value of the record being changed.
Pre-Cutover TTL Reduction
At least 24β48 hours before the migration window, reduce the TTL on your A records and CNAME records to 300 seconds (5 minutes):
example.com. 300 IN A 203.0.113.50
www.example.com. 300 IN A 203.0.113.50This means that after you update the record to the new IP, the old cached value expires within 5 minutes for most resolvers β not 48 hours. This is the single most impactful technique for minimizing the DNS propagation window.
Name Server vs. A Record Updates
There are two distinct DNS cutover approaches:
- Change A records only (while keeping the same authoritative nameservers): Propagation follows the record's TTL. Fastest approach if your domain registrar allows direct record management.
- Change nameservers (point to the new host's DNS): Nameserver TTLs are typically 24β48 hours and are not under your direct control. This approach takes longer.
Prefer A record updates when possible. Manage your domain's DNS through your Domain Registration control panel for direct record-level control.
Keeping the Old Server Active During Propagation
Do not cancel or shut down the old hosting plan immediately after DNS cutover. Keep it running for a minimum of 72 hours. During propagation, a portion of your users will still resolve to the old IP β those requests must continue to be served. Shutting down the old server prematurely creates a real outage for those users.
Phase 7: Post-Migration Monitoring and Validation
Uptime and Performance Monitoring
Configure external uptime monitoring immediately after DNS cutover β not after you think propagation is complete. Tools to deploy:
- UptimeRobot or Better Uptime β HTTP(S) checks every 1β5 minutes from multiple geographic locations
- Google Search Console β watch the Coverage and Core Web Vitals reports for anomalies in the 7 days post-migration
- New Relic or Datadog β application-level performance monitoring if your application warrants it
Identifying and Resolving Post-Migration Errors
Run a crawl of the new site immediately using Screaming Frog or a wget mirror:
wget --spider --recursive --no-verbose --output-file=crawl_log.txt https://example.com
grep -i "broken|404|error" crawl_log.txtCommon post-migration issues and their causes:
| Issue | Likely Cause | Resolution |
|---|---|---|
| β | β | β |
| 404 on all pages | `.htaccess` missing or mod_rewrite not enabled | Restore `.htaccess`, enable `AllowOverride All` |
| Database connection error | Wrong credentials in config file | Update `wp-config.php` or `.env` |
| Mixed content warnings | Hardcoded `http://` URLs in database | Run search-replace on database |
| Email not sending | SMTP relay not configured on new server | Configure Postfix or use SMTP plugin |
| Images broken | File permissions incorrect | `find /var/www -type f -exec chmod 644 {} ;` |
| Redirect loop | SSL redirect duplicated in `.htaccess` and Nginx | Remove duplicate redirect rule |
Fixing Hardcoded URLs in WordPress Databases
A frequent and subtle issue: WordPress stores the site URL in the database, and many themes and plugins store absolute URLs in serialized data. After migration to a new domain or protocol, run:
wp search-replace 'http://old-domain.com' 'https://new-domain.com'
--all-tables
--precise
--report-changed-onlyThe --precise flag handles PHP serialized data correctly, which naive string replacement breaks.
Phase 8: Cancel the Old Hosting Plan
Cancel the old plan only after all of the following conditions are confirmed:
- DNS propagation is complete (verify with
dig +trace example.comfrom multiple locations) - Uptime monitoring shows 100% availability for at least 72 consecutive hours
- No 404 errors or broken links detected in crawl logs
- Email delivery is functioning correctly on the new server
- Analytics show normal traffic patterns with no anomalous drops
- You have a local copy of all backup files independent of either hosting provider
Technical Key-Takeaway Checklist
Use this as your migration execution checklist:
Pre-Migration
- [ ] Exported 90-day resource usage baseline (CPU, RAM, I/O, bandwidth)
- [ ] Documented full software stack with exact version numbers
- [ ] Reduced DNS TTL to 300 seconds at least 24 hours before cutover
- [ ] Created and tested full backup (files + databases + cron jobs + email)
- [ ] Validated PHP version and all required extensions on destination server
- [ ] Translated
.htaccessrules to Nginx format if switching web servers - [ ] Installed and validated SSL certificate on new server before DNS change
During Migration
- [ ] Transferred files using
rsyncwith checksum verification (rsync -avz --checksum) - [ ] Imported database and verified row counts match source
- [ ] Tested full site functionality via
/etc/hostsoverride before DNS change - [ ] Updated application config files (database host, credentials, site URL)
Post-Migration
- [ ] External uptime monitoring active within 5 minutes of DNS cutover
- [ ] Old server kept running for minimum 72 hours post-cutover
- [ ] Full site crawl completed; all 404s and broken links resolved
- [ ] Hardcoded URLs corrected in database (especially for WordPress)
- [ ] Google Search Console monitored for 7 days post-migration
- [ ] Old hosting plan cancelled only after all above items confirmed
Frequently Asked Questions
How long does DNS propagation actually take, and can I speed it up?
DNS propagation duration is determined by the TTL value of the record being changed, not a fixed 48-hour window. If you reduce your A record TTL to 300 seconds at least 24 hours before migration, most resolvers will pick up the new IP within 5β10 minutes of the change. The 48-hour figure applies to nameserver delegation changes, which have TTLs outside your control.
Will migrating to a new host hurt my Google search rankings?
A correctly executed migration with no downtime, preserved URL structure, and valid SSL has no negative SEO impact. Rankings can drop temporarily if the new server is slower, if URLs change without proper 301 redirects, or if the site is inaccessible during crawling. Monitor Google Search Console's Coverage and Core Web Vitals reports for 14 days post-migration.
What is the safest way to transfer large databases without corrupting data?
Use mysqldump with the --single-transaction flag for InnoDB tables to ensure a consistent snapshot without table locks. Transfer the dump file over SSH using scp or rsync rather than phpMyAdmin, which has file size limits and timeout constraints that cause silent truncation on large databases.
Do I need to reinstall my SSL certificate after migrating?
Yes. SSL certificates are bound to the server's private key, which lives on the original server. You must either reissue the certificate on the new server (free for Let's Encrypt) or export the private key and certificate chain from the old server and install them on the new one. Ensure the certificate is fully validated before updating DNS, so HTTPS works immediately after cutover.
How do I verify that my migration is complete before cancelling the old plan?
Run dig +trace example.com @8.8.8.8 and dig +trace example.com @1.1.1.1 to confirm both Google and Cloudflare resolvers return the new server's IP. Check uptime monitoring for 72 consecutive hours of clean responses. Crawl the site for 404 errors and verify email delivery. Only after all these pass is it safe to terminate the old hosting account.
