If your current web hosting service isn’t providing you the service that you need, then it may be time to switch hosting services.
Many people are reluctant to move web hosting providers because they’re afraid the process of moving their website and email to a new service will be complicated and result in downtime.
The reality is that if you learn how process works and spend some time planning, you’ll be able to move your website to a new hosting service provider without downtime.
Glossary of terms
Domain Name Registrar – A domain name registrar is a company that manages the registration and renewal of domain names, enabling you to host your domain at any web hosting service that fits your needs.
Many, but not all, domain name registrars offer web hosting as well, but some do not. Likewise, many (but not all) web hosting services are also domain name registrars.
Name servers – Are the servers that handle the Domain Name System (DNS) management for a domain name. The configuration file used to control a domain name’s called a DNS zone file. Most hosting service providers list a primary and a secondary name server that looks something like this:
Domain Name System (DNS) – The DNS Is the hierarchical, distributed database that maps IP addresses (numbers assigned to web servers and other resources) to human-friendly domain names. All web hosting customers should have a basic understanding of the DNS. Here’s a primer that will teach you what you need to know for Managing DNS for web hosting.
Email hosting – While frequently bundled with web hosting, it’s not necessary to host email at the same hosting service that handles your web hosting. You can choose a service, such as G Suite and Office 365, to host your email and another service to host your website.
Web hosting control panel – Before the advent of web hosting control panels, it required a great deal of technical training to make changes to a web hosting account, yet with the advent of user-friendly web-interfaces, it requires much less technical knowledge to manage a web hosting account successfully. The Ultimate Guide to Web Panels will teach you what you need to know about control panels to take control of your web hosting.
Time to Live (TTL) – The TTL is the amount of time that other name servers cache information about your domain name such as how to find your website and how to route email to you. When actively making changes to your DNS, it’s useful to temporarily set the TTL to a low number (say 15 minutes) so that changes take effect faster.
When you’ve completed the DNS edits you need to make (e.g., you’ve successfully migrated your website to a new host and got it working with your domain), then it’s important to go back and change the TTL to its original higher value. Otherwise, there will be a lot of unnecessary DNS lookups, which could affect your website’s performance.
Move your website to another web hosting service
Step 1 - Choose a new web hosting company
Sign up for the new web hosting service. To avoid downtime, you’ll want to fully set up your new hosting service and get your website working with your domain name before you cancel your old hosting service. At this point, we highly recommend that you consult the expert and user reviews available on HostAdvice. You can either use the overall best web hosting services page, where web hosts are ranked by users and experts across all parameters, or if you already know which type of hosting service you need, you can see an updated list of the best web hosting services in each specific category, such as the best web hosts for VPS hosting, best cloud hosting, best shared hosting etc…
Step 2 - Backup your files and data then upload them to your new hosting account
There are several options for backing up your website, though using a Secure File Transfer Protocol (SFTP) client is the most efficient method in most cases. SFTP enables you to quickly and securely transfer files between computers.
The workflow is the same regardless:
- Copy your website directories and files from your old hosting account to your local computer (that’s the backup).
- Copy your website directories and files from your local computer to your new hosting account.
Option 1 – Use a Secure File Transfer Protocol (SFTP) client
You can backup your website by downloading all the directories and files to your local computer using an SFTP client, which is a program used to transfer files back forth between two computers. There are many FTP clients available, but FileZilla is one of the most popular FTP clients, offering versions for Windows, Mac, and Linux.
Use FTP to copy all of your website’s directories and files to your local computer.
Then use FTP to copy these same files from your local computer (where you backed up your files) to your new hosting account.
Note: You can find the FTP settings in the documentation of your current hosting service and the documentation of your new hosting service. Typically, the root directory for your website will be called public_html, but this may be different depending on the web hosting service. Check your new web hosting provider’s documentation for details on the directory structure and name of the root web directory.
Option 2 – Use Secure Shell (SSH) to backup your files
If you’re more technically oriented, you may opt to use SSH to copy your files from your old hosting account to your local computer and then to your new hosting account. The most popular SSH application for Windows is Putty, while Mac and Linux users use SSH commands from the command prompt.
The SCP command copies files from the source to the destination.
Logged into your local computer, here’s how you’d copy files from your old hosting account to your local computer:
Logged into your local computer, here’s how you’d copy files from your local computer to your new hosting account:
Option 3 – Backup your files using your control panel File Manager
If your website’s small and If your hosting service offers a web hosting control panel such as cPanel, you may be able to use the control panel’s built-in file manager to copy your website’s files and directories from your current hosting account to your local computer.
Once you’ve copied the files from your current web host to your local computer, then you may be able to use the file manager at the new hosting service to copy the files from your local computer to your new hosting account.
As with FTP, you’ll want to copy the files into the root directory of your website, which is often public_html, but check the documentation of your new hosting provider to learn about any differences in the directory structure between your old and new hosting providers.
Step 3 - Export your database from the old host and import it at the new host (if applicable)
Check your host’s documentation for the process for exporting your database from your old host and importing it to the new host.
If you use a Content Management Systems (CMS), such as WordPress, you’ll want to follow your hosting provider’s instructions specific to the CMS you’re using.
WordPress, and other popular CMS’s use the MySQL database, which can often be exported from your old host right from your old host’s control panel using PhpMyAdmin. You’ll then likely be able to login to the control panel of your new host, create a MySQL database, and then import the database using PhPmyAdmin. Spend some time reviewing both your old and new host’s documentation for details on this process.
For WordPress, it’s critical that you make a backup copy of the wp-config.php file. Then change your wp-config.php file to work with your new host.
After you’ve edited and saved wp-config.php in your new hosting account, you’ll likely be able to use PhpMyAdmin to import the database. See your host’s documentation for the specifics.
Step 4 - Log files and website analytics files
You may want to transfer your logs and analytics data to your new host. Check both your old and new host’s documentation on how to move the log files and website analytics files over to your new host. You may be able to import these logs and analytics into your new host so that you have continuity of metrics.
Step 5 - Test your website before changing your DNS
Load your website using the IP address or other URL provided by your host to load your website before making any changes to the DNS for your domain name. Test all links, forms, and other elements of your website.
Your new web hosting service should have a URL that you can use to access your website before you’ve configured your domain name to work with the new host.
Test the website thoroughly before changing the domain name to point at your new hosting service.
Step 6 - Change your nameservers or transfer your domain name registration
Once you’ve determined that everything’s working well at the new hosting service, it’s time to make your website work with your domain name.
Because web hosting and domain name registration services are distinct services, you do not need to change your domain name registrar when you switch to a new web hosting service provider. While it’s convenient to manage the name servers and pay for domain name renewal through the same service, it is not a requirement.
Option 1 – change the name servers to point at a new host.
If you’re happy with your registrar, you can keep your domain name registration there, changing the nameservers to point at the new hosting service.
Once you make the change, you’ll do all your domain name management in the new hosting service DNS manager. However, you’ll still need to use your registrar to manage the renewal of your domain name and to change your name servers again if you change hosts in the future.
In your hosting control panel, you’ll see an option to change the name servers. Reference your new host’s documentation for the specific name servers to use:
Choose a day and time to make this final change when your website and email are likely to see the least amount of traffic and usage. That way, if there is any time lag from the time you change the name servers until your website is live at the new hosting service provider.
It’s often best to make DNS changes at a time of day when the website’s likely to get lower traffic, which frequently means it’s best to make DNS changes at night or on the weekend.
Changes to DNS records can take effect within ½ hour but sometimes take from 12 to 24 hours for the DNS change to fully propagate around the Internet.
Test your website when the changes first take effect and then again in a day or two to make sure everything’s working.
Avoid making any new edits to the website at the new host for a couple of days while you ensure that the website’s working at the new host.
Option 2 – Transfer your domain name registration to your new hosting service
If your new web hosting service is also a domain name registrar, you can transfer your domain name registration to your new host. You’ll need to first “free” your domain from your current registrar, and then you’ll need to complete the transfer from your new hosting account.
In the control panel of your domain name registrar:
- Obtain a domain name transfer authorization (called an EPP code)
- Unlock the domain name
- disable privacy protection
- Make sure you receive email sent to the administrative contact for the domain name
At your new registrar (hosting service)
- Initiate the domain name transfer
- Enter the domain name transfer authorization code (EPP code) when prompted
- Complete the domain name transfer
Once you’ve completed the domain name transfer, it usually takes effect within a couple of hours, but consult your web host’s documentation for guidelines, as it can take days for the process to complete.
You can avoid downtime by keeping your website live at both your old and new host until you’ve confirmed your website works with your domain name at your new host.
Step 7 - Test your website with your domain name.
Once you’ve changed the DNS, do a whois lookup to confirm that the name server or domain name transfer have been successfully updated the whois database (the database of all domain names).
Once the DNS changes have taken effect, test your website thoroughly, asking someone in another location to visit the website, as well as that, will give you more confirmation that the changes you made are propagating across the Internet.
It’s best to keep the website live on both the old and the new web hosting service until you’ve confirmed the everything is working with your domain at the new host.
Step 8 - cancel your old web hosting account
Once you’re confident everything’s working as expected, including your website and email (if applicable), then cancel your old web hosting service.
However, if you’re still maintaining your domain registration at your old host, you’ll have to keep a domain registration account open on your old host.
Moving Email hosting
In many cases, you’ll be migrating your email hosting to the same service as your web hosting, but in some cases, you’ll host your email on a different host from your website. The process of moving your email hosting will involve the same steps in either case.
Step 1 - Setup your email accounts on the new host
You’ll want to create the same email accounts at the new host so that they’re ready to go once you make the changeover. You’ll also want to re-create any forwarders or aliases that you were using at the old hosting service.
Before you decide to move your email hosting, confirm that the new hosting service supports the protocol that you’re using for email.
Post Office Protocol (POP) – With POP, you download your email from the mail server to your local machine using an email program such as Outlook. IMAP has supplanted POP as the most commonly used email protocol.
Internet Message Access Protocol (IMAP) – With IMAP, you read the email on the server, enabling you to check your email from multiple devices, making IMAP more useful than POP in most cases.
Webmail – Many hosting services enable you to send and receive email through a secure web interface. You can use webmail and IMAP together as both read your email on the server rather than downloading your email.
Simple Mail Transfer Protocol (SMTP) – This is the Internet standard for sending outgoing email.
Step 2 - Configure the email settings in your email programs.
If you check your email using email clients such as Outlook, Apple Mail, iPhone, etc., you’ll want to configure these programs for the new hosting service. Your new hosting services documentation will have the settings for incoming and outgoing email, which you’ll then enter into the settings of your email clients.
Step 3 - Transfer your email folders
If you’re using IMAP currently and will use IMAP at the new email service, here’s the process for transferring the mail folders over to the new email host.
- Create exact email accounts on the new host as you have on the current host.
- Assign the same password to the new accounts as you’re using the current email accounts (you can change the passwords later if you want).
- In your email program (such as Outlook, Thunderbird, etc.), create two email accounts with these criteria (account pointing to old host is probably already in place).
- Both accounts must use the same email address (exact spelling) and same password
- Both accounts must be set up using IMAP.
- The IMAP email settings will be different for each account. Use the IMAP settings for the old host in the current account (the current account likely already exists your email program), and use the IMAP settings for the new account pointing to the new host in the other account.
- Open up the inbox for the account that connects to your old server. Drag and drop messages from your current inbox to the inbox on your new server.
The process may take a few minutes to transfer your emails to the new account, but when it’s complete, you should have access to all your emails in the new account.
Copy your email folders using cPanel
If both your current hosting account, and your new hosting account both use cPanel, and you use the IMAP protocol (where email is stored on the server), you can use cPanel to download your email folders then upload them to your new account.
Step 4 - Change the Mail eXchanger (MX) records
If you’re switching email hosts, you’ll want to make sure the Mail eXchanger (MX) records are changed from your current host to your new host’s MX records.
An MX record is the DNS record that enables mail to reach you at your domain name. Each MX record has the hostname (e.g. email.example.com) and a priority number, which tells servers trying to deliver mail to you which mail server to try first. The lower the priority number, the higher the priority.
In the following example, the Mail Transfer Agent (the server that’s trying to deliver mail to you would try mx.example.com first and, if that didn’t work for some reason, it would then try mx2.example.com If that didn’t work, it would retry multiple times to deliver the email. Your new email host’s documentation will list at least one MX record to use.
When changing MX records, you’ll look in your DNS manager to change your MX records from the host you’re using now to the new host.
You may want to change the Time to Live (TTL) to a lower number temporarily so that the changes you will propagate around the Internet faster.
You’ll want to go back later after you’ve successfully migrated to the web hosting service to change the TTL back to its original value.
A short TTL is useful when you’re actively making DNS edits. When you’re not making changes, a short TTL will result in unnecessary DNS lookups, which could slow down your website’s performance.
Step 5 - Test your email
Once you’ve completed the change to your DNS records, you’ll want to send test emails using an outside account (e.g., a Gmail account) to your email address at your domain name then reply to those test emails.
You’ll want to repeat tests for other email accounts you’ve moved over and make sure that forwarders and aliases are working correctly at the new hosting service as well.
Test the following:
Email accounts (mailboxes) – Send and receive to and from each of the email accounts that you’ve created to make sure they all work as expected.
Email aliases (forwarders) – Send an email to each address that’s supposed to forward to one or more other addresses to make sure aliases are working as expected. Also, if users need to be able to send “From” aliases, you’ll want to make sure the email client or webmail interface is setup with that configuration.
Google Groups – If you’re using Google Groups or something similar, you’ll want to make sure that when someone replies to an email sent to the group that the default “reply-to” is what you’re expecting. Review all the Groups settings to make sure they reflect your privacy requirements and so on.
Moving a website from one hosting provider is likely to go smoothly and without downtime with some planning and carefully timing when to make the DNS changes to minimize disruption. It’s also critical to take some time to review the documentation on this process in the knowledge bases of both your old and new web hosting service.
The key is to get your website working correctly with your domain name at your new hosting service before canceling your old hosting account, and it is critical to making backup copies of all files just in case.
If you spend some time reviewing DNS basics and spend some time reading about the process of migrating a website to a different web hosting service provider, you’ll have the knowledge you need to make the switch without downtime.