Migrating your website to a new hosting provider can feel like a stressful undertaking. The main concern for most business owners is simple: downtime. If your website goes offline during a transition, you risk losing customer interactions, e-commerce transactions, and search engine visibility.
However, website migrations do not require downtime. By following a structured process, you can move your entire site—including your database, files, and mailboxes—without your visitors ever realizing a switch has occurred. This step-by-step guide explains how to perform a zero-downtime migration.
The Golden Rule of Website Migration
The secret to a zero-downtime website migration is simple: keep both your old and new hosting packages active simultaneously.
Many people make the mistake of canceling their old hosting account before setting up or pointing to the new one. This causes the website to go offline immediately. Instead, your old site must remain fully online until the new site is ready, tested, and the DNS changes have propagated globally.
Step 1: Lower Your DNS TTL (Time to Live)
DNS records tell the internet where your website files are stored. The TTL (Time to Live) value on these records determines how long internet service providers (ISPs) cache your server's IP address. A high TTL (e.g. 86400 seconds or 24 hours) means it will take a full day for visitors to see your new host after you update your DNS records.
A few days before your planned migration:
- Log in to your current DNS manager (usually cPanel or your domain registrar).
- Locate your zone editor and find the TTL values for your main A records and MX records.
- Lower the TTL values to a low setting, such as 300 seconds (5 minutes).
- Save the changes.
Now, when you eventually update your DNS records during the migration, the internet will check for updates every 5 minutes instead of caching the old server address for a full day.
Step 2: Copy Your Website Files and Database
Next, you need to copy all files and databases from the old server to the new one.
- Files:Use an FTP client (like FileZilla) or the file manager in your old cPanel to download a compressed ZIP archive of your website’s root directory (usually
public_html). Upload this ZIP file to your new server and extract it in the corresponding directory. - Database:If you are running a database-driven site (like WordPress), log in to phpMyAdmin on your old host, select your database, and export it as a
.sqlfile. On your new host, create a new MySQL database and user, associate the user with the database, and import the.sqlfile. - Configuration:Update your website configuration file (e.g.
wp-config.phpfor WordPress) with the new database name, username, and password details.
Step 3: Recreate Email Accounts
If your email mailboxes are hosted on the same server as your website, you must recreate these accounts on the new server before switching your DNS. Log in to your new hosting console, navigate to the Email Accounts section, and create the exact same addresses (e.g. info@yourdomain.co.za) with the same passwords.
This ensures that when the DNS records propagate, incoming emails are received seamlessly by the new mail server without bouncing.
Step 4: Test the Website on the New Server
Before pointing your domain to the new host, you must verify the new site functions correctly. Since your domain is still pointing to the old server, you need to perform a local override to test it.
You can do this by editing the `hosts` file on your computer:
- Find the IP address of your new hosting server.
- Open the hosts file on your computer (located at
C:\Windows\System32\drivers\etc\hostson Windows). - Add a line mapping your domain to the new IP, for example:
192.168.1.100 yourdomain.co.za. - Save the file.
Now, when you type your domain into your browser, it will load the files from the new server, allowing you to check links, forms, and assets. The rest of the world will continue to see the live site loading from the old server. Once testing is complete, delete that line from your hosts file.
Step 5: Update Your DNS / Nameservers
Once you are confident the website works perfectly on the new server, it is time to make the switch. Log in to your domain registrar and update your nameservers to point to your new hosting provider (or update the DNS A records if you manage DNS elsewhere).
Because you lowered your TTL values in Step 1, the transition will occur very quickly. Visitors will start resolving to your new server within minutes.
Step 6: Keep Both Servers Live for 48 Hours
Even with a low TTL, some ISPs take up to 48 hours to update their cached DNS tables. Keep your old hosting account active during this window. If a visitor is routed to the old server, they will still see the website; if they are routed to the new server, they will see the new site.
If you run an e-commerce store where database data changes constantly, consider putting the old site in "maintenance mode" or disabling checkout during the DNS switch window to avoid database synchronization issues.
Why Not Let the Experts Handle It?
While migrating a website is manageable with the right technical steps, many business owners prefer not to deal with database imports, FTP directories, and DNS zones.
When purchasing a hosting package with a reputable provider, check if they offer free migrations. For example, our team provides seamless, zero-downtime migration support across all our Web Hosting packages.
If you manage multiple WordPress client sites and need ongoing support, a professional WordPress maintenance service can manage your migrations, backups, and configurations regularly.
Moving to CoreHosting? We'll Move You Free
Sign up for any hosting package and our expert engineers will migrate your website and email files with zero downtime.
Claim My Free Migration