Migrating a website to a new hosting provider is one of those tasks that sounds terrifying but is actually straightforward when you follow the right process. The fear of downtime, broken links, and lost data keeps many people on subpar hosting for months or years longer than they should be. The reality is that a well-planned migration causes zero downtime for your visitors.
This guide walks you through the complete migration process, from preparation to post-migration verification. Whether you are moving a WordPress blog, a WooCommerce store, or a custom-coded website, the fundamental steps are the same.
Before You Start: Pre-Migration Checklist
Preparation prevents problems. Complete this checklist before touching anything:
- Document your current setup. Note your PHP version, database version, server type, and any custom configurations. Your new host needs to match or exceed these specifications.
- List all components to migrate. Website files, databases, email accounts, SSL certificates, cron jobs, DNS records, and any custom server configurations.
- Create a full backup. Download a complete backup of your files and databases from your current host. Store it locally and in cloud storage (Google Drive, Dropbox) as insurance.
- Check your domain registrar. Know where your domain is registered (it might not be with your hosting provider) and have login credentials ready for DNS changes.
- Lower your DNS TTL. 48–72 hours before migration, reduce your DNS TTL (Time to Live) to 300 seconds (5 minutes). This ensures DNS changes propagate quickly when you switch.
- Notify your team. If others manage content or process orders on your site, let them know about the migration timeline.
Serverlys Tip: When you sign up for Serverlys hosting, our migration team handles steps 1–5 for you. We manage the entire process including DNS configuration, with zero downtime guaranteed. Learn about our free migration service.
Step 1: Set Up Your New Hosting Account
Sign up with your new hosting provider and set up your account. Do not cancel your old hosting yet — both accounts need to run simultaneously during the transition.
Verify Server Compatibility
Before migrating, confirm your new server supports everything your site needs:
- PHP version: Match or exceed your current PHP version. If your site runs on PHP 8.2, ensure the new host supports PHP 8.2 or higher.
- Database: Same MySQL/MariaDB version or newer. Downgrading database versions can cause compatibility issues.
- Server modules: Check for required Apache/Nginx modules (mod_rewrite, mod_headers, etc.) and PHP extensions (GD, cURL, mbstring, etc.).
- Resource limits: Ensure the new plan provides sufficient storage, bandwidth, and memory for your site.
Step 2: Transfer Your Website Files
Method 1: Using a Migration Plugin (WordPress)
For WordPress sites, migration plugins automate the entire file and database transfer:
- Install a migration plugin (All-in-One WP Migration, Duplicator, or UpdraftPlus) on your current site.
- Create an export package that includes files, database, plugins, and themes.
- Install WordPress on your new hosting account.
- Install the same migration plugin on the new WordPress installation.
- Import the export package on the new site.
- Update the site URL in settings if needed.
This method works for sites up to 500MB–2GB depending on the plugin and hosting limits. For larger sites, use the manual method below.
Method 2: Manual Transfer via cPanel or FTP
- Export your database. Access phpMyAdmin on your current host, select your database, and export as SQL format. For large databases (over 50MB), use the command line:
mysqldump -u username -p database_name > backup.sql - Download your files. Use an FTP client (FileZilla, Cyberduck) or cPanel File Manager to download your entire public_html directory. For large sites, use SSH with
tar -czf backup.tar.gz public_html/to compress first. - Upload files to new host. Upload your files to the new hosting account's web root directory. Use FTP, SSH, or the cPanel File Manager.
- Import your database. Create a new database on the new host. Import your SQL backup via phpMyAdmin or command line:
mysql -u username -p database_name < backup.sql - Update configuration files. Edit your site's configuration (wp-config.php for WordPress, .env for Laravel, etc.) to use the new database credentials.
Method 3: Host-Assisted Migration
Many hosting providers offer free migration where their team handles everything. You provide access credentials to your current host, and their migration team transfers files, databases, and configurations. This is the safest option for non-technical users and typically completes in 24–48 hours.
Step 3: Transfer Email Accounts
If you use email hosting through your current provider (you@yourdomain.com), you need to migrate email accounts separately:
- Recreate email accounts on your new host with the same usernames and settings.
- Export email data from your current accounts using an email client like Thunderbird (which stores emails locally) or use IMAP migration tools.
- Import email data to your new accounts. Tools like imapsync can transfer emails between servers directly.
- Update MX records as part of the DNS change (covered in Step 5) to route incoming email to the new server.
If you use Google Workspace or Microsoft 365 for email, your email is not hosted with your web host — you do not need to migrate it. Just keep your MX records pointed to Google or Microsoft during the DNS switch.
Step 4: Test Before Switching DNS
This is the most important step for zero-downtime migration. Before changing DNS to point to your new server, verify that everything works on the new host.
Test Using Your Hosts File
You can preview your site on the new server without changing DNS by editing your local hosts file:
- Find your new server's IP address (provided by your new host).
- Edit your hosts file:
- Windows:
C:\Windows\System32\drivers\etc\hosts - Mac/Linux:
/etc/hosts
- Windows:
- Add a line:
NEW.SERVER.IP.ADDRESS yourdomain.com www.yourdomain.com - Save the file and clear your browser cache.
- Visit your domain in a browser — you will see the site on the new server.
Testing Checklist
Verify each of these before switching DNS:
- Homepage loads correctly with all images, CSS, and JavaScript
- Internal links work (test at least 10 pages)
- Forms submit correctly (contact forms, signup forms)
- Ecommerce functionality works (add to cart, checkout process)
- SSL certificate is installed and HTTPS works
- Admin panel / dashboard is accessible and functional
- Media files load (images, videos, downloads)
- Email sending works (test a contact form submission)
- Redirects are in place (301 redirects, .htaccess rules)
- Cron jobs are configured and running
After testing, remove the hosts file entry so your computer returns to normal DNS resolution.
Step 5: Switch DNS
Once testing confirms everything works on the new server, it is time to update DNS. This is the step that determines whether your migration has downtime.
The Zero-Downtime DNS Strategy
- Keep both servers running. Do not cancel or disable your old hosting account yet. Both old and new servers should serve your site simultaneously.
- Update DNS records. Log into your domain registrar (or DNS provider) and change the A record to point to your new server's IP address. If your new host uses nameservers, update the nameserver records instead.
- Wait for propagation. DNS changes take 2–24 hours to propagate globally (faster if you lowered the TTL in advance). During this time, some visitors will see the old server and others will see the new server.
- Monitor both servers. Watch traffic on both the old and new servers. When traffic on the old server drops to near zero, propagation is complete.
- Freeze content changes. During DNS propagation, avoid making changes on either server. Any changes made on the old server after DNS switch will not appear on the new server.
Because both servers are running the same site during propagation, visitors experience zero downtime regardless of which server their DNS resolves to.
"The secret to zero-downtime migration is simple: never turn off the old server until the new server is fully verified and DNS has propagated. Both servers run simultaneously during the transition, so every visitor gets a working site."
Step 6: Post-Migration Verification
After DNS has fully propagated (24–48 hours), verify the migration is complete:
- Verify DNS resolution. Use a tool like whatsmydns.net to confirm your domain points to the new server's IP address globally.
- Test all critical pages. Run through your testing checklist again on the live domain.
- Check Google Search Console. Submit your sitemap and check for any crawl errors on the new server.
- Verify analytics tracking. Ensure Google Analytics, heatmaps, and other tracking tools are recording data from the new server.
- Monitor uptime. Set up an uptime monitoring tool (UptimeRobot, Freshping) to watch the new server for the first 7 days.
- Test email delivery. Send test emails from your domain and verify they are delivered and received correctly.
- Check speed. Run speed tests (GTmetrix, PageSpeed Insights) to verify performance on the new host meets or exceeds the old host.
Step 7: Cancel Old Hosting
Wait at least 7 days after DNS propagation is complete before canceling your old hosting. This buffer ensures:
- DNS has fully propagated for all visitors worldwide (some ISPs cache DNS longer than others)
- You have a working backup to fall back to if any issues appear
- Search engines have had time to re-crawl your site on the new server
Before canceling, download one final backup from your old host as permanent archival storage. Then cancel the old account.
Special Considerations
Ecommerce Migrations
Ecommerce sites require extra care because orders and customer data are constantly changing:
- Time your migration during low-traffic hours (typically 2–5 AM in your primary timezone).
- Put your store in maintenance mode during the final database sync to prevent order discrepancies.
- Sync the database twice: once during initial migration and once immediately before DNS switch to capture any new orders.
- Verify payment gateway connections (Stripe, PayPal) work on the new server before going live.
- Test the complete checkout flow with a real test transaction.
WordPress Multisite Migrations
WordPress multisite installations require updating the domain mapping for each sub-site in the database. Use a search-and-replace tool like WP-CLI's wp search-replace command to update all URLs in the database from the old domain to the new domain.
Custom Application Migrations
For custom-coded applications (Laravel, Django, Node.js), ensure your new server has the correct runtime versions, dependencies, and environment variables configured. Test the application in a staging environment on the new server before switching DNS.
Serverlys Tip: Our migration team specializes in WordPress, WooCommerce, and custom application migrations. We handle the entire process — files, databases, email, DNS, and SSL — with zero downtime and zero cost. Request your free migration.
Common Migration Mistakes to Avoid
- Canceling old hosting before DNS propagates. This is the number one cause of migration downtime. Keep both servers running for at least a week after the DNS switch.
- Forgetting to update database credentials. After importing your database to the new server, update the connection string in your site's configuration file.
- Ignoring SSL setup. Install and verify your SSL certificate on the new server before switching DNS. A missing SSL certificate causes browser security warnings.
- Not testing forms and transactions. Pages may look correct but forms, checkout processes, and dynamic features can fail due to different server configurations.
- Forgetting about hardcoded URLs. Check your database and configuration files for hardcoded URLs that reference the old server's IP or temporary domain.
Frequently Asked Questions
How long does a website migration take?
The actual file and database transfer takes 1–4 hours depending on your site's size. DNS propagation adds 2–24 hours. Including preparation and post-migration verification, plan for the entire process to take 2–3 days. Your site has zero downtime during this period if done correctly.
Will my SEO rankings be affected by migration?
A properly executed migration should not affect SEO rankings. Keep your URL structure identical, ensure 301 redirects are in place, submit your sitemap to Google Search Console after migration, and maintain the same page speed or better. Temporary ranking fluctuations of 1–2 positions are possible during re-indexing but typically resolve within 2–4 weeks.
Can I migrate my website by myself without technical knowledge?
For WordPress sites, migration plugins like All-in-One WP Migration make self-migration accessible to non-technical users. For complex sites (ecommerce, custom applications), we recommend using your new host's free migration service. The risk of data loss or misconfiguration is not worth saving a few hours of migration team time.
What if something goes wrong during migration?
This is why you create a full backup before starting. If anything goes wrong on the new server, your old server is still running and serving visitors. You can take as much time as needed to fix issues on the new server without any impact on your live site. The worst case scenario is reverting DNS back to the old server.
Do I need to transfer my domain to the new host?
No. Your domain registration and your hosting are separate services. You only need to update DNS records to point your domain to the new server. You can keep your domain registered anywhere — changing nameservers or A records is sufficient to direct traffic to the new host.