On average, a web hosting account is moved between servers once every two years.
As a website owner or website administrator, it is one of those things that you will do at some point.
Whatever the reason that will drive this decision, you want your migration to be flawless and with minimal downtime as possible.
Thankfully, cPanel and WHM make this process intuitively easy.
1. Don’t Cancel Your Existing Web Hosting Account
At 2cPanel, 40% of the customers we currently serve left another web hosting platform for ours.
Sometimes out of frustration and/or to get out of bad hosting experience, they will in their haste ask the old web host to terminate the hosting account.
Mow, there is nothing wrong with doing this, as keeping the account means that you will still be paying for the webspace.
But the thing is that if your web host honor this request without following up with you to ensure that you understand the ramification of this request, you may end up without the data you need to restore the website on your new hosting platform.
So before you contact your present hosting provider to ask them to terminate your account, please make sure that you have completed making a full backup of your data.
Ideally, do not cancel your existing hosting account until your data has been migrated and the website up and running and tested.
2. Plan And Assess Business Impact The Migration Will Have
As with anything in life, planning will always play a crucial role in
Before starting the process, determine the reason for such action and assess the impact it will have on your business.
Figure out what problems you are trying to solve by migrating and make sure that you have found solutions to them before you move to a new hosting account.
This might range from a slow-loading website, lack of features, dealing with website malware infestation, awful customer support to “upselling” tricks that keep draining cash out of your pocket
3. Declutter and Remove Trash
When you interact with any environment, you accumulate.
It is one of the things that defines humans at this stage of our evolution.
While a well-configured cPanel system would have been configured to automatically empty your .trash folder after a set the number of days, chances are that this might not happen before your migration date.
There may be unneeded files, directories, plugins/modules that are no longer needed.
You may need to get rid of these for a better hosting experience when you move to your new hosting account.
It also makes the job of anyone helping you easier.
To delete a file or folder, perform the following steps:
- Login to cPanel.
- Click File Manager in the Files section of cPanel.
- Select the file or folder you want to delete.
- And from the toolbar, click Delete. The Trash window will appear.
- Click Trash File(s) to confirm that you want to delete the file or folder.
If there a need to restore a file or folder, perform the following steps:
- Click View Trash from the toolbar.
- Select the file or folder that you want to restore.
- Click Restore in the toolbar.
- Confirm that you want to restore the item.
If you are not sure how to do this, ask your web hosting support team to help you clean up.
It is also helpful to check your website error logs and address any issue that you might see there before proceeding.
4. Backup Or Duplicate Your Hosting Environment
It is almost universally acknowledged that one must diligently and regularly take backups of his or her data when doing anything online.
The same is applicable to website hosting.
Never ever rely on what your web host does for you when it comes to backing up your website data.
Don’t just rely on the assurances and promises that your data will always be safe.
While it might be true that they will back up your data, the
It means that if something should happen, what you will receive may be a week out of date.
The real value of having your own backup lies in being able to use the backup to restore your site to the state it was when something happened that caused you to lose access to your website.
It is also helpful when you want to migrate to a brand new, trouble-free host.
If you are doing this yourself, the best approach is to replicate your existing environment on the new host an hour or two before you hit the DNS change buttons.
5. Check PHP Versions
If your website is running a PHP application, ensure that the new hosting account has a compatible PHP version or have a way of addressing incompatibilities between your source server and destination.
This will make your migration as painless as possible and minimize downtime.
If the PHP version needs to be upgraded, test your application code before switching PHP versions in a production environment.
If your website is using old PHP versions, then you must find a web host that supports old PHP version hosting.
To check PHP versions in cPanel, login to cPanel and scroll down Software >> MultiPHP Manager.
The interface allows you to easily manage your account’s PHP configuration and also will give an idea of the PHP version that you are running.
To change a domain’s PHP version, perform the following steps:
- Select the check-box for the domain that you wish to change.
- Select the desired version of PHP from the PHP Version menu. To always use the system default, select inherit.
- Click Apply.
The system will change the selected domain’s PHP version.
You can also use the Server Information interface to view your server’s version of cPanel & WHM or specifics about Apache or PHP on your account.
It displays information about your account and the server that hosts your account.
Most of this information is only useful for advanced cPanel users.
If you are moving to 2cPanel, you can host your older PHP version with security updates without the need to change your PHP version.
6. Check Your Website .htaccess File
.htaccess is a directory-level configuration file that can be used to alter your web server configuration (enable or disable additional features) for a specific account.
The .htaccess file takes effect over the entire directory it is placed in, including all files and subdirectories.
There are times that the custom rules you place on this file may not be compatible with the environment you are moving to.
For example, if you use a third-party application or content management system such as WordPress®, you may need to add other rules to enhance your website performance or security.
Such rules might not be compatible with the way the new host engineers have configured the server you will be moving in to.
Thus as a safe bet, back up the file as old.htaccess.txt, then remove those custom rules before migration.
If you need them at the destination and have confirmed that the rules you have will work without issues, you can either rename the file to .htaccess or copy the custom rules to the new .htaccess file.
If you are unable to see your .htaccess file,
- Login to your cPanel and click on File Manager
- Once the page opens, ensure that the “Show Hidden Files” is ticked; you will not be able to view the .htaccess file if it is not ticked.
To edit a .htaccess file, right-click the file and select Edit.
7. Lower Your DNS TTL (Time-To-Live)
Time to live (TTL) refers to the amount of time or “hops” that a sent packet can exist inside a network before being discarded.
It determines how long a DNS cache server can serve a DNS record before reaching out to the authoritative DNS server and getting a new copy of the record.
Most domain registrars use TTL between 3600 to 14400 seconds for how long a cached content should be served before a new copy will be fetched from an origin server.
It means that changes made on at the DNS level will not reflect until 1-4 hours later.
So set the TTL times on your DNS to a short value (something like 300 seconds will do) 12-24 hrs, before the actual migration and DNS changes.
8. Schedule Time For The Migration
Use your website logs to determine the hours that your visitors or customer visit your website most.
If you are using cPanel, there are more than 3 different types of metric tools that you can use for this: Analog, AWStats, and Webalizer).
Then find a 3-hour-window during which you cannot edit your site to do the lifting.
9. Restore & Verify
Using SFTP or Terminal or SCP or cPanel File Manager, copy all your files, databases and settings to the new host.
Once all files, databases and everything has been move or replicated in the new environment, it is time to make the DNS changes and check to see if the website is still online.
We recommend contacting the Migration Team of your new host and ask them to do this for you.
10. Change DNS Records Including Nameservers To New Set
This is where you will determine if all your previous efforts are enough to give you the result you need.
Login to your domain registrar or the dashboard where all your website DNS records are located and change the records to point to the one you received from your new host replacing the old A records and nameservers with the ones you received in your new hosting account email.
If you don’t have these, circle back to your new host support team and get (verify) the new records.
Then visit https://developers.google.com/speed/public-dns/cache and flush your DNS records so the ones can be picked up faster.
It is recommended that you flush your main domain name first before you flush any subdomains whenever you changed the DNS servers for your domain.
This ensures name server delegations are flushed before refresh attempts for subdomains get stale data from your old DNS servers.
Then wait for propagation or check with any of these tools:
If you see the new A record reflected, then your website or domain is now using it.
For nameservers, flush your local machine DNS and run on your Terminal this command:
dig NS domain_name.com
This will display your current name-server set.
If these seem like too much work, just visit http://leafdns.com/ and it will do all the work for you:
11. Monitor & Then Cancel Old Account
Keep an eye on the website for at least 72 hrs and if everything is OK, do go back and delete all the data of the website that you have migrated from at your previous hosting account.
And then, only then … cancel the old web hosting account.
cPanel makes website migration very easy and has improved to the point that 70% of most website migration can be completed within 5 minutes (especially if the source and destination share similar systems including control panel).
If you are unsure what to do, ask our migration team to help you migrate your website.