How to Properly Change Web Hosts With No Downtime
Last updated on Apr 4, 2023
For one reason or another, you may decide to change web hosts. When changing hosting providers, the last thing you want is for your websites to experience downtime. Regardless of how or when the move takes place, one thing remains crucial — you want to have your website up and running on the new host before you make any cancellation with your old host!
Getting Started With Switching Web Hosts
After you’ve finished researching new web hosts that meet your requirements and have decided on one to sign up with, you generally have two moving options.
The first option is to ask your new web hosting provider to take care of the entire process of transferring everything over from your old hosting account to your new one. Most web hosts will do this for you for free if the old hosting account and new hosting account are both cPanel. If you want to be completely hands off from the moving process all your new host will need is your old hosting account’s cPanel login credentials. Then they can retrieve all of your data for you and restore it on your new hosting account.
Or if you prefer to be more involved in the transfer process you don’t need to provide the new host with your old cPanel login information. Instead, if you already have a full cPanel backup from your old hosting account or you don’t mind creating one yourself, you can just provide a full cPanel backup to them to restore on your new hosting account and you’ll be all set.
Full cPanel Backup Creation
Here’s how you go about creating a full cPanel backup:
- Login to your cPanel account and under the “Files” section click on the “Backup” icon.
- Click on the “Download a Full Website Backup” button.
- On the next page click the “Generate Backup” button. By default this will create a full cPanel backup in your home directory and send you an email notification once the backup has been created.
The next screen…
You’ll get an email that tells you how to access your full cPanel backup file.
A full backup has completed and is available for download.
You can access a list of locally-stored backups via cPanel’s “Backups” interface:
cPanel > Backup > Download a Full Website Backup
The backup file is named “backup-date_time_cpaneluser.tar.gz”
The server saved the backup file in the “/home/cpaneluser/” directory.
Backups Available for Download:
backup-backup-date_time_cpaneluser.tar.gz (Mon Aug 29 20:53:36 2016)
Some web hosts seem to try to make it as hard as possible for customers to create backups. For example, sometimes the full cPanel backup option is hidden/disabled in cPanel themes or the backup process will time out and fail to complete. This can be a real pain in the ass if you are trying to switch hosting companies!
If for some reason you are unable to create a full cPanel backup you or your new web hosting company will have to move everything piece by piece (files/folders, databases, emails, etc.) manually to your new hosting account.
After you’ve uploaded everything onto your new hosting account and you’re certain everything is working perfectly, you will need to change the nameservers for your domain name(s) (this is usually done through your domain registrar, e.g. NameCheap, GoDaddy, etc.).
Waiting for the DNS Change to Take Effect
Once the nameservers have been changed, it can take up to 48 hours for the changes to take full effect. Before you close down your old hosting account, you need to make sure that your domain name is pulling content from your new hosting account. You can use a DNS checker like https://dnschecker.org to make sure that propagation has occurred worldwide. Once you’ve confirmed this, and you are certain you have everything you need from your old account you can confidently close/cancel your old web hosting account. If you follow these steps, you can rest assured that you won’t experience any downtime.
Accessing Websites on New Hosting Plans Before Changing Nameservers
Each time you type out a web address in your browser, what happens in the background is that it gets changed into an IP address. The domain name is essentially an easy way to remember the location of a website. Without domain names, we would all have to memorize IP addresses for the multiple websites we visit. With the help of a service called Domain Name Service (DNS), website domain names are quickly translated into IP addresses and the pages we request are pulled from the servers they are located on.
When you change web hosts, you are essentially changing from one IP address to another. In order for the domain name to translate into the new IP address, you have to change the domain nameservers for your domain name.
There is a basic way and a more advanced way for you to access your website(s) on your new hosting account before changing the nameservers to make sure that everything is functioning correctly.
The basic way is to simply go to the IP address your hosting account is on followed by your cPanel username. Your new web host will send you an email with your new account information which usually includes this link under the title “Temporary Webpage URL”. For example:
Temporarily you may use one of the addresses given below to manage your web site:
Temporary FTP Hostname: 198.51.100.3
Temporary Webpage URL: http://198.51.100.3/~cpaneluser/
If you have an addon domain that you’d like to check you would simply put that domain name at the end of the Temporary Webpage URL. For example: http://198.51.100.3/~cpaneluser/addondomain.com
If you have a simple static website the temporary webpage URL option should work well enough for you to test things out. However you’ll run into some problems with testing if you’re using any scripts or content management systems (e.g. WordPress, Drupal). Instead you’ll need to go the more advanced route which is to modify the hosts file on your computer.
To modify the hosts file here is what you need to do:
- On your PC, find the program called “Notepad“, right click on it, and then select “Run as administrator“
- Next, open up the “hosts” file in “Notepad” — Go to “File“, select “Open“, then go to c:\windows\system32\drivers\etc and look for a file named “hosts“
- Go to the very end of the existing text in the “hosts” file and on a new line add the IP address of your new hosting account followed by the domain name (ie: 198.51.100.3 yourdomain.com). Then right below that line add the IP address followed by your domain with the www. before it (ie: 198.51.100.3 www.yourdomain.com) and then save the “hosts” file. If you have any other domains (addon domains) on the account that you need to test out add those domain names as well (ie: 198.51.100.3 addondomain.com).
- Open your command prompt and type in IPCONFIG /FLUSHDNS and hit the enter key — you should get the following message:Windows IP ConfigurationSuccessfully flushed the DNS Resolver Cache.After following these steps (1 – 4) if you open your browser, you should be able to view your website on the new hosting account to see if everything is functioning correctly. Keep in mind that you are the only one who is viewing this, as you have not yet changed your nameservers! Only after your nameservers have been changed, your website will become publicly available on the new hosting account.
- Last, but not least, when you’re done testing don’t forget to remove any lines you added in step 3 to the “hosts” file on your PC and save the file.
Remember, websites may experience downtime if the old hosting account is removed or cancelled too soon after you’ve uploaded the website content to the new host and changed to the new host’s nameservers, since it doesn’t allow enough time for the domain name to propagate to the new nameservers. Wait at least a couple of days before closing down your old hosting account to allow for propagation to occur worldwide.
Looking for a reliable hosting provider to switch to? Check out the web host rankings page to see which web hosts are recommended the most.