How to change hosts with little trouble
Reasons for which people change hosts
Most people (web based business owners, webmasters etc.) often have to change their hosts because the service is not good enough. Repeated and/or long downtimes, poor support, rude support or even total lack of responses from the part of the host are some of the most common reasons why people decide to change hosts.
Another reason for leaving the current host is that the services no longer fit the website. Perhaps the website receives so much traffic and/or becomes so important that a more advanced form of hosting is necessary (dedicated server) and their current host does not provide that. Unfortunately only a small fraction change their host for such a "good" reason.
Anyway, whatever the reason, here are the steps everyone should take in order to change hosts as fast and as neat as possible:
Find the right host
Although it might sound obvious, I have to stress this. Find a good new host! If this is your first site (and host) you'll need all the help you can get to get started in this new endeavor. A good host helps you!
If your current host is good and you decide to move to another, cheaper host, and that new host proves to be a lot worse than your old one, you'll be very sorry for doing so and you'll soon find out that you are in fact prepared to pay more, only to get the kind of service that you were used to.
If your host was bad, moving to a new bad host will not change anything. If you're like most people, you'll be worried about having to pay higher prices for better service. Don't be. You usually get what you pay for. Going from one bad and/or cheap host to another host that's just as bad but cheaper is just like running in circles; you're not going anywhere that way!
You have to break this vicious circle and do a decent job: find a decent host. No, it doesn't have to be expensive. Expensive is no guarantee for quality. It simply has to be a quality host!
Common problems when changing hosts
When one changes hosts there are a few common problems that can occur, but once we know the problems, we humans usually do find solutions.
The first problem associated with the change of hosting providers is downtime. If you're leaving your current host because you experienced excessive downtime, more downtime is not exactly what you're looking for, is it?
Another common problem is the loss of incoming email messages. Some email messages are crucially important and you never know when they'll be coming. Losing them could mean losing important deals and thus money, and no one wants that.
Back-up the whole site
Experienced webmasters always have a back-up copy of their website(s). Often they place that copy in more than a single place: either on 2 separate hard drives, or one copy on a hard drive and one on a CD etc.
Oh, yes! I know that most hosting companies blatantly advertise the fact that they make regular backups. Although they might keep backup copies, serious backup systems are not that often used because of their costs. And even if they are serious, another copy doesn't hurt, does it?
You should also know that hosts usually don't guarantee the safety of your data. If you read their TOS carefully you'll find that they are not responsible for any loss of data. You might also find that the backups that they're making are going to be used only internally, within their company, and not given to the customers. While this is something that can be negotiated at times (which means a that a certain fee will be involved), this is not something to rely on. It is best to have your own up to date backups.
Anyway, the first step when moving to a new host is to copy the contents of your website (usually using an FTP client, but you can use Front Page if that's what you're used to using).
Special care is needed because the directory structure must remain unchanged for your website to function properly on the new server. If you change it, some links or other references will not work properly.
If your website is rather large it might be a good idea to ask your current (soon to be "old") host when it's a good time to do a backup. If you load the server too much, the host might stop your backup process and even shut-down your website. It's always better to ask for permission first. It's not necessary to tell them you want to change hosts though.
Test the website at its new location
After the account is created the new host will send you an email with the account name, password, IP that you can use to access your account/website, nameservers etc. If that email doesn't provide all the necessary information or you just don't know how to use it ask your new host for help. If you took the necessary precautions in choosing your new web host, the host will gladly help.
To visit the site at its new location, you can also use a trick. You can edit the hosts file on your local computer, and make it act as if the domain has already propagated. If you're interested in how to do this, this wikipedia article and this tutorial should be of help.
Upload the website to its new location and configure the account's settings, set file permissions, directory passwords and email addresses. If the host allows it, setup a "catch-all" email address (for temporary usage). That should ensure that any email that comes to an address that you somehow forgot to setup will not bounce back to the sender and that you'll receive it anyway.
All hosts know that new clients usually need a decent amount of support to get their sites up and running. As first impressions count very much, even not-so-good hosts sometimes prove to be quite helpful in the beginning. Lack of support at this stage is not a good sign at all. If the support isn't good now, it might be that despite your best efforts to find a good host, you did not find what you were looking for.
Now, if you're new to the web, don't expect the host to also help you design your website. Asking for things that are not hosting related is not something they care much for -- if you know what I mean. Just as you choose a host, the host also chooses its clients.
Back to testing... Test as many pages as you can. Verify if the internal links are working properly. Get used to their control panel.
Test the email accounts. Test to see if you can connect to the mail server and if you can send emails. Because at this stage you did not change the nameservers, you will have to setup new accounts in Outlook (or whatever similar program you use) using the IP address instead of the usual "mail.yourdomain.com". Don't know what I'm talking about? Ask the host for help. How to setup Outlook is one of the most common questions out there.
With those newly set accounts you will be able to see if any errors occur. You'll also be able to send emails. However, for the time being, no emails will come into your inbox because the nameservers associated with your domain are not modified yet.
If your website is database driven, things are a bit more difficult, especially if you run a forum where people post very often.
Whatever the situation, try to first figure out what changes you have to do so that people visiting the old website will in fact use/add data from/to the new database, located at your new host. Ask your new host for help in this department.
Before you actually change anything, create a new database (with the same name as the old one) on the new server. Test it; make sure it works OK. You should do your best to ensure that most potential problems are detected at this stage.
Now I'll treat the busy/idle database situations separately:
1. If the database isn't used very often and/or you can accept that a little bit of the data that was added recently by the visitors might be lost, or if you are the only one adding content to the database, you can change hosts without actual downtime.
All you have to do is upload a copy of your database to the new hosting account. If your visitors can add data or you need to add data on a regular basis, set things so that the new database will be used by the old website too. All these things should be done and tested right before changing the nameservers.
2. If new content is added to the database very often and out of your direct control, things do get a little bit trickier and I'm not aware of a perfect solution. I will give you the best advice I can, but you'd better talk this through with your programmer and/or new host to see what other options you might have.
The problem is that the probability that the database is modified while you transfer it from the old host to your computer and then back to your new host is too big (especially when the database is large and your internet connection is slow). Add to that the time it takes to "instruct" the old website to add new data to the new location and troubleshoot the whole thing and you'll realize that some new data might be written to the old database while you're busy doing all this moving stuff.
To speed-up the process you might ask your new host to handle the transfer of the database, meaning that they'll download the database from your old account to your new account. That should halve the time it takes to transfer the database and the number of differences between the transferred database and the database located at the new host will be kept to a minimum.
By using the IP to navigate though your website (using the new host), you should be able to notice if any problems occur. Solve them before going any further. If solving them takes too long you might consider retransferring the database after you troubleshoot everything. Some hosts might not generally allow customers to browse their sites by using the IP. You should ask you host to change this for your account temporarily, so that you can do these tests.
As soon as the database is moved and everything is error free, you should set the old website (located at the old host) to work with the new database located at the new host. Again, your new host can give you more detailed advice at this stage. As you might've noticed by now, the importance of choosing a good host that provides quality and timely support becomes increasingly visible.
Now the old website should write data to the new database. It's just like having your database remotely hosted, which is not a very uncommon technique. It's actually used by some hosts who run the databases on different machines than the actual web servers. Since the database will most likely be in a different physical location, probably thousands of miles away, your site might be somewhat slower during this time.
Another strategy (if we can call it that) is to temporarily close the site and notify the visitors that maintenance is under way. Even the most seriously and professionally run websites, from the most prestigious companies, temporarily close for maintenance from time to time. There's no shame in doing this; some things just can't be done while the system is running. Like when you're repairing a TV or another appliance: you have to shut them down.
Now that the site is closed, you can do anything you want, in whatever order you like. You might want to do all that you have to do in a hurry, because the downside is that the website is closed, of course.
Not losing Emails
While propagation is in progress (read further; the term will be explained) your website "lives" in two different places. Depending on the "road" that the information takes, emails can be delivered to your old host rather than the new.
To make sure that you don't lose any emails while the new nameservers are propagated all over the Internet, you should create new accounts in Outlook (or whatever similar program you use).
Most web hosting companies use the typical "mail.yourdomain.com" as email server. While your website is in this transition period called propagation, "yourdomain" can point to the old host or the new host, so you never really know which place people are getting connected to or where emails go to. To overcome this you can create two new accounts in Outlook for each email address @yourdomain.com, using as incoming email servers the IPs sent to you by each host when they created the accounts, instead of the usual "mail.yourdomain.com".
You should use these new accounts to verify emails sent to your domain but "landing" in those two different places. After the propagation is over and you send (copy or forward) all the emails that are on the old server to the new location, you can use the regular email server mail.yourdomain.com and delete the IP based accounts.
Another option would be to connect to the control panel by using the IPs instead of using the domain name and then access the webmail feature.
Change the nameservers
The nameservers associated with your domain name are used to determine where the website is actually located. In other words, they point to the server where the site's data is located. The typical domain names are ns1.hostingcompany.com and ns2.hostingcompany.com, but they can have totally different forms.
If you've thoroughly tested how the website behaves on new account then everything should be running smoothly. You are now ready to change the nameservers. That means that you have to either login to your account at the domain registrar or contact the registrar to do the change for you.
After the change is done it usually takes about 2 days for all the internet to notice the change. This process is called propagation. However, some ISPs might use the old nameservers for a longer period, sometimes as long as two weeks, so it would be best not to close the account that you had with your old host for a while. Keep verifying if any email gets sent to the old host rather than the new one and also make a habit out of verifying the activity logs on your old hosting account. The activity should be null after two or three days, but some people, as I said, might be directed there for a longer period.
Normally, after two weeks or so, the activity on that account should stop completely and you'll be able to notify the old host that you no longer need their services. Don't forget (or pretend to forget) to ask for any money that the old host might owe you (perhaps a prorated refund). It's your money and you should do everything within reason to get them back. Of course, check the TOS you agreed to first. You might not be entitled to any refunds after a certain period.
Changing hosts is far from pleasurable. It's something that you'd better not have to do very often. That's why choosing a good host is of extreme importance.
Changing hosts is not very complicated, but it takes a certain amount coordination and synchronization. Testing before actually changing anything is very important. I remember how I once changed the nameservers although the website wasn't working on the new account. I figured that it shouldn't take much to solve any problems I could have had, so I thought: why not hurry things up and get the propagation going while I'm working on things.
Well, it took me more than a day and by that time I and some visitors were already unable to access my website because the new nameservers we being used by now. That definitely wasn't my best day! So test before you change.
As a closure statement, I wish you to go through this process so rarely that each time you'll change hosts you'll need this article to guide you because by that time you'll forget all about how it's done! Cheers!