Moving Your Website to a New Host Without Downtime

Topic: Web Hosting Level: Intermediate 3 min read By the ITPlus724 team

Your current host is slow, its support doesn’t respond, or the contract is ending, and you need to move the site. Managers mostly worry about downtime, but in practice the bigger problems tend to show up elsewhere: email that lived on the old host, a contact form that no longer sends email, or an SSL certificate that wasn’t issued on the new server. With planning, you can move a site so that users never notice.

Step 1: Take inventory before anything else

Before you start, know exactly what you are moving:

  • Site files and the database or databases
  • Addon domains and subdomains on the same account
  • Mailboxes, forwarders and filters, if email is also on this host
  • Scheduled tasks (Cron Jobs), custom PHP settings and .htaccess rules
  • Current DNS records, especially A, MX and TXT

If your company email is on the old host, plan the email migration separately. Changing the domain’s NS records without paying attention to the MX records is the most common reason email gets lost during a site migration.

Step 2: Lower the TTL

A day or two before the move, lower the TTL of the site’s A records to a small value, such as 300 seconds. That way, when you point the record to the new IP, most users reach the new server within minutes rather than hours.

Step 3: Make a full copy on the new host

Take a full backup of the site: files and a database export. If both hosts use cPanel, a full account backup and restore on the new server is usually the simplest path, and some hosts handle this transfer for you. Otherwise:

  1. Upload the files to the new host.
  2. Create the database and database user, and import the export.
  3. Update the database connection details in the site’s configuration file, such as wp-config.php in WordPress.
  4. Set the PHP version and required PHP extensions to match the old server, or to a newer compatible version.

If the site’s address is also changing, replace URLs in the database with a tool that won’t break WordPress’s serialized data; a simple text replace in the database export file usually causes problems.

Step 4: Test before changing DNS

You don’t have to wait to see the site on the new server. By adding one line to your own computer’s hosts file, you can point just that computer to the new server. On Windows, this file is at C:\Windows\System32\drivers\etc\hosts, and the line will look something like 203.0.113.50 company.com www.company.com. Now test everything: pages, dashboard login, search, forms, payments and email sent from the site. Remove the line when you’re done testing.

Step 5: Migration day

  1. During a low-traffic period, freeze content changes; orders or posts submitted on the old server in the meantime will be lost.
  2. If the site changed after the first copy, transfer the database once more.
  3. Point the A record to the new IP, or, if you’re also moving DNS to the new host, create all records there before changing the NS records.
  4. Once traffic reaches the new server, issue or verify the SSL certificate.
  5. Test forms, email sent from the site and scheduled tasks again.

After the migration

Keep the old host active for at least several days to a week or two, so you have a way back if a problem appears. Review the new server’s error log and 404 error reports, and once you’re confident, restore the TTL to its usual value. Before canceling the old account, keep one final full backup of it for your archive.

Checklist

  • A complete list of sites, databases, mailboxes and DNS records
  • TTL lowered a day or two before the move
  • Full testing on the new server using the hosts file
  • Content changes frozen during the migration
  • Valid SSL and working site email on the new server
  • The old host stays active until you are fully confident

ITPlus724 engineers migrate websites and email to cPanel hosting with full planning and testing, so the move happens without noticeable downtime.

Request a free consultation Our services

Get a free consultation for your IT infrastructure

Our engineers review your current setup and recommend the best way forward.

An engineer is onlineReady to help right now
Request a consultation +98 21 9101 0265
Call nowFree consultation