How to Switch From One Web Host to Another (Step-by-step Guide)

Note: Post updated September 6th, 2016.

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, low costs, and 100 percent uptime.

Unfortunately, the world is not ideal and this perfect scenario rarely – if ever – exists.

How Web Host Switching Works?

Moving your website to a new host is a bit like moving to a new home in the physical world.

Switching web host vs. moving to a new house

Think about it – when you move, you first find a new location, then sign the paperwork, pack up all of your belongings, and physically move them to the new location. If you are moving a business, after doing all of this, you finish the move off by hanging a new sign over your door to advertise your new digs.

Moving your site is something similar – only a virtual version. You shop for a new location, sign the paperwork to rent hosting space (in the account type of your choice – shared server, dedicated server, VPS, etc.), package up your site to ensure that all of your assets come with you, transfer everything to your new web host, and then point your domain to your new host by changing the DNS record; this final step is in essence hanging the sign over your new shop door.

Though it can be a process, it is completely attainable.

A Step-by-Step Walk Through: How to transfer your host from one company to another

Switching your host requires completing a series of actions in a specific order to ensure that everything transfers over properly. To move your website to a new host, complete the following steps.

1. Purchase a new web host

There are a variety of hosting providers out there, each with its own configuration. You will need to evaluate which is right for you based on a number of factors, such as cost, required space, and server configuration, to name a few. When purchasing, consider registering your domain to a third party provider 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.

Dig deeper: How to choose and select the right web host

2. Back up your sites to the new web host

Static files comprise any type of file that does not frequently change, automatically or via a content editor – such as in-place graphics or copy. To back up a static website, simply copy the old file structures over to the new web host.

For a dynamic site that runs on database (ie. MySQL), install the web apps to the new web host as they are currently held in the existing site; then move the database file to the new web host. In case your web application provides easy transfer functionality (as is the case in WordPress’ import/ export function), transfer all of your data files directly to the new web host. If your application does not offer any such functionality, you will need to tweak your MySQL and PHP configuration files accordingly.

Another easy way to move CMS sites (WordPress, for example) is to zip and move everything in your “public_html” or “www” folder to the 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);

3. Final Check Before Making the Move

Double check that everything is working properly on your website once you have loaded your files onto the new hosting configuration.

Of note, you can preview your newly hosted website using a temporary URL in IP numbers. Some hosting companies will even provide a development staging platform 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.

4. Switch Website DNS Records

godaddy dns record

Switch your website’s DNS record to the new web host’s servers at your registrar.

Your DNS record is more or less 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.

Dig deeper: Guide on how to change domain name server at Godaddy, Name Cheap, and Domain.com.

5. Wait for the DNS change to propagate through the net

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.

Important Things to Watch For

Unfortunately, anytime that you change a configuration that affects your website, there are a series of problems that may occur. Keep your eyes out for the following as you prepare for and execute the switch, as well as for a period of time after switching hosts.

1. Downtime

web hosting down

In the WWW, any time that your site is not live is time that you are losing potential readers and potential business – after all, time is money. The goal in general – never mind when you are switching web hosts – is to have zero downtime. To ensure that you do not experience downtime while making the switch, take the time upfront to ensure that everything is in place and working correctly at your new host before fully converting the files and making your site active in its new home.

Secondly, inform your loyal visitors and/or clients that you are switching hosts beforehand along with information about the hours that you are making the switch. Hopefully this will reduce the number of site visitors during the switch time period, eliminating strain on the system and also prevent any customer service headaches in case downtime does occur.

Finally, work closely with your new host throughout the transfer process. If you have any doubts or any questions, do not hesitate to ask your new host for assistance; not only does this speak to the importance of quality customer service, but some web hosts will help to transfer the FOC.

Once the switch is done, it’s recommended to monitor your site uptime closely for a period of time to ensure everything at the new host is working alright.

2. Change of site structures and missing links

hacked site

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.

Tip:  Repairing site navigation with .htaccess

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]

3. Emails

emails

Perhaps one of the most difficult parts of switching your web host is transferring your email. There are three common hosting scenarios that apply to email:

  • Scenario #1: Email is currently hosted on a domain registrar (such as GoDaddy)
    This is the easiest scenario from which to move; all you need to do is to switch the A (or @) record and point it to the new 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 respective web host
    When you make the switch to the new host, simply recreate the existing email account on the new web host and configure the new email agent.

Dig deeper: What to do when your web host does not provide email hosting service

4. Database

more hosting space needed

There’s risk where your database could be corrupted during the switch. For the ease of discussion we will focus on just WordPress in this point.

What to do when your WP database is corrupted?

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:

  • Reupload 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.

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.

The first thing you should always do whenever editing your PHP files is to make a copy of what is there. You can copy and paste into Notepad and save on your desktop. This could save you if your files get really corrupted.

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.

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.

phpmyadmin

1. Login to your control panel and click on PHPMyAdmin

choose database

2. Choose your WordPress database. This typically is titled yoursite_wrdp1. However, this can vary. You will likely see “WP” somewhere in the title, though. I have posted a sample below, but I erased my own info so my database isn’t out there for anyone to see and typed in “yoursite” to give you an idea of where to find your database. 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.

check all

3. Once the database loads, check the button that says “Check All / Check tables having overhead”.

repair-table

4. Choose “Repair Table in the drop down box to the right of where you just checked the box.

successful repair

5. 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”.

Alternative: Free Site Migration by Your New Host

If all these sound too much to you – you might want to go with the alternative and leave the migration work to your new web host.

Yep, don’t be too surprised – hosting companies are doing all they can to win new customers.

Many hosting companies, including some good ones that I recommend – InterServer, InMotion Hosting, WP Engine, A Small Orange, etc etc, will help transfer new customers’ sites to their server for free.

Take InMotion Hosting for example –

Login to AMP dashboard > Account Operations > Website Transfer Request

To initiate a site transfer at InMotion Hosting, login to AMP dashboard > Account Operations > Website Transfer Request.

I spoke to InMotion Hosting senior manager, Savag Salibian, recently to learn about InMotion Hosting’s site transfer process. And, I get the conclusion that it’s a no-brainer for the non-techie (or the lazy ones) to let their support staffs to handle the site migration work. All you need to do is to provide some login data at your old host – hostname, cPanel login, and FTP login via the Site Migration Request Form at your AMP dashboard (see image above) and InMotion will take care of the rest.

“For folks who are unfamiliar with how web hosting works, it’s actually better to use our [InMotion Hosting] free transfer program because 1- it’s free and quick, 2- zero down time, 3- our transfer specialists are available 24/7/365 via phone and live chat, and 4- we help transfer emails for free (for cPanel to cPanel)…” –  Savag Salibian, InMotion Hosting.

Dig deeper: Order and get InMotion Hosting to transfer your site

Bottom Line: Get Rid of Your Lousy Host, Today!

Making the switch to a new web host can be a stressful time, but it’s the best thing to do when you are stuck with a bad web host. If you’re already running a website, you shouldn’t have any trouble with the switch – after all, it’s just the usual backup/download/upload stuffs that you are already doing daily.

If you have any additional tips for making the switch that I have not already mentioned above – or if you have any questions – please let me know!