Skip to content
Wallet live · USDT TRC20 · USDT BEP20 · BTC · ETH · SOL · XMR Free SSL · Malware scan · Instant image 24/7 desk · @rexahost
RexaHostRexaHost

Guides

How to Migrate a Website to a New Host Without Downtime

· 6 min read

How to Migrate a Website to a New Host Without Downtime

Moving hosts does not have to mean downtime or lost emails. A tested, step-by-step migration plan for WordPress and other sites, from inventory to DNS cutover.

Key takeaways

  • Inventory everything first: files, databases, email, DNS records, cron jobs and SSL.
  • Lower your DNS TTL a day before the move so the switch propagates quickly.
  • Copy and test on the new server using a hosts-file override before changing DNS.
  • Freeze content changes during the final sync to avoid losing orders or comments.
  • Keep the old host for a few days after cutover as a safety net.

A website migration sounds risky, and done in a hurry it can be. Done methodically, it is routine. The secret is simple: build and test the site on the new server while the old one keeps serving visitors, and only switch DNS when everything is confirmed working. This guide gives you that process, step by step, for shared hosting and VPS targets.

Phase 1: Plan and inventory

Before you copy anything, list what you are moving. Missed items cause most migration problems.

ItemWhere to find itNotes
Website filespublic_html or web rootInclude hidden files like .htaccess
DatabasesphpMyAdmin or MySQLNote names, users and passwords
Email accountsMail settings in your panelMailboxes, forwarders, aliases
DNS recordsYour DNS providerA, AAAA, CNAME, MX, TXT (SPF, DKIM, DMARC)
Cron jobsPanel or crontabScheduled tasks and their timing
SSL certificatesPanel or serverFree certificates can be reissued
PHP version and extensionsPanel or php -vMatch or test compatibility
Special settings.htaccess, Nginx configs, php.iniRedirects, upload limits, rewrites

Phase 2: Choose and prepare the new host

  • Shared hosting suits most WordPress and small business sites. RexaHost shared plans include cPanel, LiteSpeed, free SSL and daily backups. Cloud Grow hosts up to five sites for $3.58 a month.
  • A VPS suits custom stacks, larger sites or several projects. VPS Basic (2 GB RAM, $5.98) or VPS Pro (4 GB, $11.58) are common starting points. Set it up first with our security checklist.

Pick a location close to your visitors and match the PHP version of the old host, or plan to test a newer version.

Phase 3: Lower the DNS TTL

At least 24 hours before the planned switch, log into your DNS provider and lower the TTL on the A (and AAAA) records for your domain and www to a short value such as 300 seconds. Resolvers that cached the old, longer TTL will expire it within a day, so when you change the IP, most visitors pick up the new address within minutes.

Phase 4: Back up everything

  1. Create a full backup on the old host (panel backup or manual).
  2. Download it to your own computer or storage, so you hold a copy independent of both hosts.
  3. For WordPress, also export the database separately as an SQL file.

Phase 5: Copy files and databases

Method A: cPanel to cPanel

If both hosts use cPanel, a full account backup can often be restored on the new server, carrying files, databases, email and settings in one step. Ask support whether they can assist with the restore.

Method B: Manual copy (any host)

  1. Files: download via SFTP or a compressed archive, then upload to the new web root. On a VPS, rsync -avz user@old:/path/ /var/www/site/ copies directly between servers.
  2. Database: export with phpMyAdmin or mysqldump -u user -p dbname > site.sql, create a new database and user on the new host, then import with phpMyAdmin or mysql -u user -p newdb < site.sql.
  3. Configuration: update the app's config file (for WordPress, wp-config.php) with the new database name, user, password and host.

Method C: WordPress migration plugins

Plugins that package the site and database into one archive simplify the process for WordPress. Check archive size limits and test the restore carefully.

Phase 6: Test before switching DNS

This is the step that prevents downtime. Make your own computer see the new server while everyone else still sees the old one.

  1. Edit your local hosts file:
    • Windows: C:\Windows\System32\drivers\etc\hosts (open Notepad as administrator)
    • macOS and Linux: /etc/hosts
  2. Add a line: NEW_SERVER_IP example.com www.example.com
  3. Flush your DNS cache and open the site in a private browser window.
  4. Test thoroughly: homepage, inner pages, images, forms, login, search, checkout, admin area.
  5. Check server error logs for PHP warnings or missing extensions.
  6. Remove the hosts entry when done.

Phase 7: Final sync and cutover

For sites with frequent changes, such as shops, forums or busy blogs, data added to the old server after your copy would be lost. To prevent this:

  1. Announce a short maintenance window, or put the old site into maintenance or read-only mode.
  2. Export the database again and import it on the new server.
  3. Sync any new uploads (rsync makes this quick).
  4. Update the A and AAAA records to the new server's IP.
  5. Issue the SSL certificate on the new server once DNS points there, if it was not already issued.

Our guide to pointing a domain to your server covers DNS records in detail.

Phase 8: Email

  1. Create the same mailboxes on the new host.
  2. Update MX records, and SPF, DKIM and DMARC TXT records for the new mail server.
  3. Copy old messages using an IMAP sync tool, or by connecting both accounts in a mail client and dragging folders across.
  4. Keep the old mailboxes for a few days to catch messages delivered during propagation.

If email is hosted separately (for example with a dedicated email provider), leave MX records unchanged.

Phase 9: After the move

  • Monitor uptime and error logs for a few days.
  • Recreate cron jobs on the new server.
  • Set up backups on the new host and test a restore.
  • Raise the DNS TTL back to a normal value once stable.
  • Cancel the old hosting only after a safe overlap, ideally a week.

Timing your migration

Choose a low-traffic window for the final sync and DNS change. Check your analytics for the quietest hours, which are often late night in your main audience's time zone. Avoid migrating just before a product launch, a sale or a holiday when you might not be available to fix problems.

Give yourself a buffer. Plan the copy and testing for one day and the cutover for the next, so you are not rushing through tests late at night. If something looks wrong during testing, you can simply postpone the DNS change: visitors are still on the old server and nothing is lost.

Large sites and special cases

  • Very large media libraries: copy uploads in advance with rsync, then run a quick incremental sync at cutover. Only changed files transfer the second time.
  • Large databases: compress dumps with gzip during transfer, and import from the command line instead of phpMyAdmin to avoid upload limits and timeouts.
  • Multiple sites: migrate one at a time, starting with the least critical, so you refine the process before moving important sites.
  • Changing the domain at the same time: avoid it if possible. Move hosts first, confirm stability, then handle the domain change with proper 301 redirects.

Troubleshooting

SymptomLikely causeFix
"Error establishing a database connection"Wrong DB credentials in configCheck name, user, password and host
Redirects to old domain or URLSite URL stored in databaseUpdate site URL settings; run a search-replace tool
Broken imagesMissing uploads or hard-coded pathsRe-sync uploads; fix paths
500 error.htaccess rules or PHP version mismatchCheck error log; adjust PHP version
Mixed content warningsHTTP links on HTTPS siteUpdate URLs to HTTPS
Emails not arrivingMX or SPF records not updatedVerify DNS records

Migration checklist

  1. Inventory files, databases, email, DNS, cron and settings.
  2. Prepare the new host and match PHP versions.
  3. Lower DNS TTL 24 hours ahead.
  4. Take and download full backups.
  5. Copy files and databases; update config.
  6. Test via hosts file.
  7. Freeze, final sync, switch DNS.
  8. Migrate email and update mail records.
  9. Monitor, set up backups, then cancel the old host.

Moving to RexaHost? Choose shared hosting or a VPS, pay with crypto, and message support on Telegram @rexahost if you would like guidance during the move.

Frequently asked questions

How long does a website migration take?

Copying a typical small site takes under an hour. The full process, including testing and DNS propagation, is best spread over a day or two to avoid rushing.

Will my site go down during migration?

Not if you test on the new server first and switch DNS only when it is ready. Visitors are served by the old server until DNS updates.

What is DNS TTL and why lower it?

TTL (time to live) tells resolvers how long to cache your DNS records. Lowering it a day before the move means the switch takes effect quickly.

How do I migrate email?

Recreate mailboxes on the new host, switch MX records, then copy old messages with IMAP sync tools or by exporting and importing in your mail client.

Should I cancel my old hosting immediately?

No. Keep it running for at least a few days after the switch so you can recover anything missed and catch late DNS propagation.

#website migration#move website#change hosting#dns ttl#wordpress migration

Plans in this article

Servers mentioned here

Popular

Cloud Grow

Standard
$1.89 /mo
$3.22Save 41% billed monthly
  • Shared CPU
  • 2 GB RAM
  • 25 GB NVMe
  • Unmetered traffic
  • 5 websites · free SSL
  • Ashburn · London · Amsterdam · Frankfurt +6

VPS Basic

Standard
$2.79 /mo
$5.38Save 48% billed monthly
  • 1 vCPU
  • 2 GB RAM
  • 60 GB NVMe
  • 3 TB traffic
  • Root access · dedicated IPv4
  • Ashburn · London · Amsterdam · Frankfurt +6
Most popular

VPS Pro

Standard
$4.69 /mo
$10.42Save 55% billed monthly
  • 2 vCPU
  • 4 GB RAM
  • 120 GB NVMe
  • 5 TB traffic
  • Root access · dedicated IPv4
  • Ashburn · London · Amsterdam · Frankfurt +6

Keep reading

Related articles

Live Chat · offline