How to Move Your Website to Another Web Host (and Knowing When to Switch)

Article written by:
  • Hosting Guides
  • Updated: Dec 05, 2019

In an ideal world, we would never have to worry about switching web hosts – our site would remain happily housed at the current hosting provider’s facility with great load times, affordable costs, and 100% uptime.

Unfortunately, the world is not ideal and this perfect scenario rarely, if ever, exists. If your current web host is not giving what you need, it might be time to shift to a better one (we will talk about knowing when it's time to change in the later part of this article). Transferring your site to a new web host doesn’t have to be as tiring as moving to a new house. It can actually be fairly easy if you take the right steps.

How to Transfer Your Website

When moving a website to a different web host, you need to:

  1. Purchase and activate a new hosting accounts,
  2. Move all website files – including databases and email accounts,
  3. Install and configure your application (PHP version, WordPress, etc)  at the new host,
  4. Check new site on staging / temporary URL,
  5. Troubleshoot if any errors,
  6. Point your domain DNS records to the new web host

You can either outsource these tasks to you new hosting company (many will do it for free) or you can transfer your sites manually or using a plugin.

We will dive into both options in this article.

 


 

Option #1: Outsource Your Site Move (for Free)

Flowchart - Site migration using option #1 - Step 1 - Signup
Step 1- Signup

Flowchart - Site migration using option #2 - File request
Step 2 – Migration request

Flowchart - Site migration using option #1 - Step 3 - Wait
Step 3 – Wait

Picking a web host that offers free migration service is the best option for beginners and busy business owners.

Web hosting is a competitive industry – hosting companies are doing all they can to win new customers. Many hosting companies, including some great ones that I recommend, provide free website migration service to new customers. All you need to do is request a migration after signing up with the new provider and their support team will take care of the heavy-lifting.

In most cases, this is the preferred way so you can save time and focus on other crucial work with your website.

Here's what you need to do if you are going with this option:

1- Signup with a web host that offers free site migration

Good hosting companies with free site migration:

  • A2 Hosting – Well-known for its speed and reliability, shared hosting starts at $2.96/mo.
  • GreenGeeks – Eco-friendly web host, huge improvement in recent hosting performance.
  • InterServer – Reliable New Jersey-base web host, does not jack up prices ($5/mo) during renewal.
  • InMotion Hosting – Great web host with over 15 years track record.
  • TMD Hosting – Excellent performance and great price – shared hosting starts at $2.95/mo.

* Discloure: If you order via these links I will earn a commission at no additional cost to you.

2- Request site migration and provide website details

File a migration request with your new web host. Usually all you need to do is to provide login data at your old host – hostname, control panel login, and FTP login, etc; and your new web host will take care of the rest.

Example: InMotion Hosting

InMotion Hosting Website Tranfer
To initiate a site transfer at InMotion Hosting, login to AMP dashboard > Account Operations > Website Transfer Request. Click here to initiate InMotion free site migration now.

Example: GreenGeeks

You can request for GreenGeeks site migration service after the purchase. To initiate the migration, log in to your GreenGeeks Account Manager > Support > Site Migration Request > Select a Service > Provide basic account information (at your old host) such as control panel URL, account credential. Note – GreenGeeks site migration service include not just cPanel transfer, but also migration from Plesk platform.

3- Site back and relax

Yep, that's all you need to do.

No database error troubleshooting. No email accounts migration. Easy as a pie.

 

 


 

Option #2: Transfer Your Website Manually

1- Purchase a new web host

You need a new web host in place before you can initiate a host migration.

There are a variety of hosting solutions out there, each with its own configuration and offer. You will need to evaluate and compare which is right for you based on a number of factors, such as cost, required space, and server configuration, to name a few.

Also ideally you should  inform your visitors and/or clients that you are moving to a new web host, along with information about the hours that you are making the switch. It'a good PR practice to do periodically status updates on social media networks to keep your clients informed. Plus, consider asking your users not to visit your website during migration to minimize system load and prevent additional customer service headaches.

Tips:

2- Move website files and email accounts

For those who are running a static website (site with no database), all you need to do is download everything (.html, .jpg, .mov files) from your existing hosting server and upload them to your new host according to the old folder structure. The move can be done quickly using a FTP / sFTP agent. I recommend using FileZilla if you are looking for one.

Moving a dynamic site (with database) requires a little extra work.

Moving database

For a dynamic site that runs on database (ie. MySQL), you'll need to export your database from your old web host and import it to your new web host. If you are on cPanel, this step can be done easily using phpMyAdmin.

Exporting and transferring databases using phpMyAdmin
Login to cPanel > Databases > phpMyAdmin > Export.

In case you are using a content management system (i.e. WordPress, Joomla), you will need to install the applications a the new web host before importing the database. Some CMS provides easy transfer functionality (ie. WordPress’ import/ export functions) – you can use that function to transfer your data files directly using the CMS platform.

Moving a WordPress site

Moving WordPress from cPanel to cPanel

For WordPress sites on cPanel (the most common setup) hosting, the fastest way to move your site is to zip everything in your “public_html” or “www” folder, upload the folder to your new web host, and add the following two lines into your WP-config:

define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']); define('WP_HOME', WP_SITEURL);

Moving WordPress using common plugins

wordpress migrator plugin
All-in-One WP Migration helps export your WordPress website including the database, media files, plugins and themes with no technical knowledge required

Alternatively, there are plenty of good migrating plugins for those who are moving WordPress site to a new web host.  I like Duplicator – WordPress Migration Plugin and All-in-One WP Migration for their simplicity. These plugins will help you to move, migrate, or even clone a WordPress site to a new web host with no technical knowledge required.

Moving WordPress using special built plugins

siteground migrator
SiteGround Migrator automate the transfer of a WordPress site to a SiteGround hosting account.
wpengine migration plugin
WP Engine does not provide free site transfer services but they do have a special-built WordPress migration plugin for users who are switching in.

Some web hosting companies provide their own WordPress migration plugin. For examples WP Engine Automated Migration and SiteGround Migrator – these are special plugin developed for transferring WordPress sites to a designated web host. You should make use of the in-house plugins when switching to those particular companies.

Moving email accounts

Perhaps one of the most difficult parts of switching your web host is transferring your email. Basically you'll bump into one of these three scenarios:

Scenario #1: Email is currently hosted on a domain registrar (such as GoDaddy)

This email setup is the easiest to move. Login to your domain registrar (where you host your email), change your email hosting A (or @) record to the new web host’s IP address.

Scenario #2: Email accounts are hosted with a third party (such as Microsoft 365)

Ensure that your MX records, along with any other records that your email service provider needs, are updated in your DNS.

Scenario #3: Email accounts are hosted with the old web host

If you are transferring a full account from cPanel to cPanel, you don't have to transfer your email accounts manually. Alternatively, you can download all your email accounts (and all files within) from cPanel File Manager and upload it to your new web host. The process is simple – here's a step-by-step guide in case you need help).

In worst case scenario (transferring from a less user-friendly hosting control panel), you will need to re-create all existing email accounts in your new web host manually. The process can be a little tedious – especially if you are running on a lot of email addresses.

Adding an email account using cPanel (Screenshot: InMotion Hosting).

3- Final Check & Trouble Shooting

Once you have loaded your files onto the new hosting configuration, double check that everything is working properly on your website

Some hosting companies provide a development staging platform (ie. SiteGround) so that you can easily and fluidly preview your site before taking it live in the new environment, allowing you to remedy any problems behind the scenes.

Repairing site navigation errors and missing links

As you transfer your site’s assets from the previous hosting environment, it is possible for assets, such as graphics to be misplaced or for certain files to be left behind. If this happens, your visitors are likely to experience 404 errors. Keep an eye on the 404 log during and after the switch – this log will alert you of any non-working links or assets that you need to remedy to restore your site to being fully functional.

In most cases, you can make use of .htaccess redirectMatch and redirect to point old file locations to new ones. The following are some sample codes you can make use of.

Define your 404 page

To minimize the damage cause by broken links – where moved.html is the page you wish to show your visitors when there's a 404 error.

ErrorDocument 404 /moved.html

Transferring a page to a new location

Redirect 301 /previous-page.html http://www.example.com/new-page.html

Transferring entire directory to a new location

redirectMatch 301 ^/category/?$ http://www.example.net/new-category/

Redirecting dynamic pages to a new location

And, just in case you change your site structure at the new host –

RewriteEngine on
RewriteCond %{QUERY_STRING} ^id=13$
RewriteRule ^/page.php$ http://www.mywebsite.com/newname.htm? [L,R=301]

Troubleshooting database errors

There's risk where your database could be corrupted during the switch. I will use WordPress as example because that's what I am most familiar with.

In case that you can still access your WP dashboard, try to first disable all plugins and see if your database pulls up correctly. Then, re-enable them one at a time, checking the home page each time to make sure it is showing correctly.

Things would get a little trickier if you cannot access your dashboard. Try these different simple steps to see if one works:

  • Re-upload your database, writing over the new database.
  • Check where the corruption error is coming from and try to reupload that file from your old site to your new one.
  • Open the file and check to make sure it is pointing to your new server.

Solution #1: WordPress auto database repair

If those steps do not work, you may have to do a bit of coding, but I'm going to talk you through it.

First, open the new site in FTP and go to your wp-config.php file. The file should be in the main folder where you blog resides. Backup this file before you make any edits.

Look for this wording:

/** Absolute path to the WordPress directory. */

Just above that line, add this wording:

define('WP_ALLOW_REPAIR',true);

Save your changes and leave your FTP program open for now. Open up your favorite web browser. Go to the following address for the rep

http://yourwebsitename.com/wp-admin/maint/repair.php
repair screen
Either button will work to repair your database but just pick “Repair and Optimize”.
repaired database
When the process is completed, you will see a screen that looks the one below. It will even remind you to remove that repair line from your configuration file.

Solution #2: phpMyAdmin

If the above methods don't work, your next step is to head over to your database.

This can be daunting if you aren't sure exactly how databases work, but the steps are fairly simple. Even if you completely destroy the database, you should be able to just re-download from the old server and upload again. There really is no need to be afraid as long as you have your database backed up.

Access phpMyAdmin from your new web host. Choose your WordPress database. This typically is titled yoursite_wrdp1.

However, this can vary. You will likely see “WP” somewhere in the title, though (see image below). You can also find your database name listed in that wp-config.php file that you had open in the step above. Click on the database name in phpMyAdmin to open it.

choose database
cPanel > Access phpMyAdmin > Click on the database name ito open it.
check all
Once the database loads, check the button that says “Check All / Check tables having overhead”.
repair-table
Choose “Repair Table in the drop down box to the right of where you just checked the box.
successful repair
You'll be given a status about whether the tables were repaired and the top of your screen should say “your SQL query has been executed successfully”.

4- Pointing domain DNS to your new web host

godaddy dns record

Next, you'll need to switch your website’s DNS record (A, AAAA, CNAME, MX) to the new web host’s servers at your registrar.

Your DNS record is a list of “instructions” that specifies where to send the user; moving your DNS record to the new servers ensures that visitors will find your site as intended, rather than receiving an error or misdirect. This is a critical step – make sure you get the right DNS info from your new web host.

Here are the step-by-step instructions on changing your website DNS at Godaddy, Name Cheap, and Domain.com.

Tip

If your domain is currently registered at your old web host, consider transferring the domain to a third party so that in case you do ever need to switch hosts again, your domain can come with you more easily and without any potential complications.

5- Verify DNS propagation

Once you have requested to move your DNS record, the switch can take anywhere between a few hours to a full day to take live.

Once the switch go live, alert your former hosting company as to the cancellation. Monitor your site uptime closely for at least a week or so to ensure everything at the new web host is working properly.

Tip: Use What's My DNS to perform a DNS lookup to check domain names current IP address and DNS record information from multiple name servers in 18 locations. This allows you to check the latest state of DNS propagation.
DNS Map is another free DNS lookup tool to check DNS propagation status from over 20 locations.

 


 

Knowing When It's Time to Change Your Web Host

Making the switch to a new web host can be a stressful time – which is why many site owners prefer not to switch web host unless it's necessary. After all – why waste time and energy when everything is working alright?

So when is the right time to start looking for a new host? How do you know that your web host is the root cause of your website problem? Here are a few hints:

  1. Your site is constantly going down
  2. Your site is too slow
  3. Customer service is not helpful
  4. You nee more space, functionality, or other resources
  5. You are paying too much
  6. You have been hacked, more than once
  7. You have heard about a great service elsewhere

A Good Web Host = Better Sleep at Night

When I switched to InMotion Hosting years ago – the tech support was so helpful and switched my site over safely and soundly while I slept. I awoke up to website that functioned quickly and reliably without a single glitch in service.

If you don’t feel that level of comfort, or are bothered about negative reports you’ve seen on your web host, it may be time for a change.

 


 

Also read –

About Jerry Low

Founder of WebHostingSecretRevealed.net (WHSR) - a hosting review trusted and used by 100,000's users. More than 15 years experience in web hosting, affiliate marketing, and SEO. Contributor to ProBlogger.net, Business.com, SocialMediaToday.com, and more.