Insights:How to Migrate Your Website and Switch Providers: A Step-by-Step Guide
Step 1: Full Site Backup
- Pack code, templates, and configuration.
- Full database export (including views and stored procedures).
- Copy upload directory, certificates, and logs as needed.
- Verify backup is restorable: perform a test restore in a local or staging environment.
Step 2: Confirm New Environment Version
| Item | Requirement |
|---|---|
| Runtime Version | Same as or compatible with the original site |
| Extensions | Match the original site exactly |
| Database Version | As close to the original as possible |
| Charset | Identical to the original site |
Version mismatches are the most common cause of "code unchanged yet errors appear."
Step 3: Deploy and Import
- Upload code and set directory permissions.
- Import the database and verify table count and critical row counts.
- Configure rewrite rules, cron jobs, upload size limits, and timezone.
- Set up SSL certificate.
Step 4: Verify with Test Domain
- Homepage, category pages, detail pages, and search pages all accessible.
- Admin panel login, content publishing, and configuration changes work.
- Forms submit successfully; emails are received.
- Images, attachments, and downloadable files are accessible.
Do not switch the domain until everything passes.
Step 5: Transfer Static Assets and Media
- Upload all images, videos, and attachments first to avoid mass 404s after switching.
- Verify total size and file count.
- Check permissions to ensure web-readable access.
Step 6: Lower TTL
- Set the DNS resolution TTL to 300 seconds 24 hours before the switch.
- Record current resolution values for easy rollback.
Step 7: Switch DNS Records
- Update A/CNAME records one by one; do not change all at once.
- Handle MX records separately from website records.
- Immediately verify resolution takes effect across different networks after switching.
Step 8: Monitor for 1–2 Hours
- Check status codes for homepage, category pages, and detail pages.
- Look for any new anomalies in error logs.
- Verify form submissions are working properly.
- Verify email sending is working properly.
Step 9: Clean Up
- Keep the old server running for 7 days before shutting it down.
- Clean up temporary test data.
- Update monitoring and backup to point to the new environment.
- Update the sitemap and ICP filing information (if applicable).
Step 10: Post-Migration Review
- Record the switchover time, impact duration, and any issues encountered.
- Add any overlooked items to your checklist.
Common Oversights
- Forgetting to migrate scheduled tasks, causing data not to update.
- Forgetting to update backup scripts, leaving the new environment without backups.
- Forgetting to update monitoring, so incidents go unnoticed.
- Forgetting to set up 301 redirects from the old site, resulting in duplicate content.
Scope
This sequence applies to migrations within the same tech stack. If you are also changing the tech stack, split it into two operations—migrate first, then rework—otherwise issues will be difficult to diagnose.
Related Reading: