Changing Hosts - a Dummies Guide

So you've been with a host for a number of months or years and now it's time to change for whatever reason.

The following is a guide as to the smoothest process possible. There are many steps involved and over the next few weeks I'll add various pages and update where necessary. I'll attempt to include as many screen shots as possible and in that regard I'll be basing everything on using cpanel and MySql. For those not using these tools I'm hoping it should be clear enough in order to translate the information to your tools of choice. The concepts will be the same regardless.

So you want to change your hosting company

Well this is how I did it. Firstly, you should have a valid reason for wanting to change as the process of transferring files and setting up with a new host can be a daunting process. In my case I wasn't happy with my current host's performance. In short, my web site(s) pages were taking far too long to load and outages were becoming all to common. Who was the host I hear you ask? Servage.net. I've been with Servage since January 2007, so that's 16 months and still have about 5 or 6 months before renewal is due.

Even with 5 or 6 months remaining I couldn't continue with the level of performance I was getting. It was excruciating and something had to give; and it did. I bit the bullet and researched other hosting companies.

My first port of call were the various 'find a web host' type forums and I defy anybody to select a good host based solely on so-called independent reviews found in the threads of these forums. What one can establish is that it's a cut-throat business, margins are low and they're all out there willing to empty our pockets. I suppose that's called the marketplace.

I made a decision early on that cost was not going to be the sole determining factor but cost is a factor none-the-less. My whole research was based around shared hosting as dedicated servers were well and truly not within my budget, so in this regard, cost was an issue.

Short listing

The companies I shortlisted were: AN Hosting ("AN"), Hot Drupal (“HD”) and Drupal Value Hosting (“DVH”). There were some others but I discounted them when they wouldn't respond to my live chat requests. Quite frankly, if they claim 24/7 support service and I'm here in Australia, I don't care if it's 3 am in the US when I decide to ask a question. 24/7 means anytime of day.

First up, I'll say from the outset that I reckon all these companies would be suitable hosts, for my needs at least. It's ultimately up to the customer (you) to make the final decision.

The basic packages all seemed to be in sync with each other and were within a dollar or two of each other. All basic packages were offering unlimited this, unlimited that, except HD. One thing to be aware of is the so-called $4.00 or $5.00 per month rate which usually means if paying for a year in advance. If paying on a monthly basis the monthly rates shoot up towards the $10 mark.

HD and DVH were different in that both claimed to be Drupal friendly and I can't dispute that claim.

I visited numerous Drupal sites which were hosted by the three hosts clicking page after page, performing searches where I could. The upshot was that I couldn't really distinguish any substantial performance issues between the three hosts, other than they were certainly quicker than Servage.

Download tests

From all three hosts I was able to test their download speeds. AN and DVH provided a 20 mb test file and HD provided a 60 mb test file. Over a number of days and at different times of the day I ran my tests. The upshot was that DVH won out. For testing I used this site. DVH times were consistently between 24 – 29 seconds, followed by AN which were 28 – 32 seconds. For HD, as they provided a 60 mb test file, their times were between 135 – 142 seconds and therefore for a 20 mb file that equates to 45 – 47 seconds. I tested the download speed of a 20 mb file from Servage and consistently the download times were between 96 – 98 seconds, a whopping three times slower than AN & DVH.

Decision made

I discounted AN as they only had one plan and therefore was no way to upgrade to a quicker or better system, as I mentioned cost was not the overriding factor.

HD did at least have different plans which you could upgrade to. They also promoted a flexible type plan, which appealed to me. For instance, if you needed just one more MySql database and you'd used your quota they would probably accede to the request, at no cost, dependent upon other factors such as not pushing the limits in every other way, if so they they'd prefer the customer upgrade. This is a common sense type of approach.

It was a toss-up between HD and DVH. Both answered all my questions promptly and I believe honestly (only time will tell). In my mind the telling factor was the download speed tests and so DVH won out.

Sign up

The sign-up process with DVH went through smoothly. Within 30 minutes (probably sooner - I didn't time it) I received a number of introductory emails advising usernames and passwords for accessing the web site administration pages (cpanel).

I signed up for their “Worlds Best Hosting Package” which gives me 50 gb of disk space and all the usual other stuff plus a reseller account. I'm not sure what I'm going to do with the reseller account but at this stage will probably be for close friends and family.

Please note, the link I provided for DVH is my affiliate link, which means any sales made will be credited to my account. The links I provided for AN and HD are not affiliate links.

Actual Processes Involved

Firstly, it goes without saying that you need access to your old host in order to carry out any of the following procedures. If you haven't got access to your old host, then in a nutshell, you're stuffed.

The following pages will show the processes and procedures required in order to transfer a Drupal system from one server to another. The concepts though can be applied to any database driven application.

Reduce File Size

  • accesslog,
  • all tables starting with 'cache' and
  • watchdog.

Screen shot - Empty Tables

The emptying out process is not absolutely necessary but you will note that the table 'accesslog' holding 24,000 odd records accounts for nearly half of all records in the database. Simply click the 'Empty' button alongside the relevant table name. As is usual with this type of operation you must confirm that you do in fact do want to empty the table. The term used is 'truncate' which means empty the table.

Screen shot - Confirm Empty

Note that we are not deleting the table, merely emptying the records.

Repeat this for all the tables to be emptied as listed above (also highlighted in the image above).

Backup old host database(s)

At your old host, access phpMyAdmin, you're going to backup your database(s) which will ultimately be downloaded to your computer.

Screen shot - MyPhpAdmin

Click the Export tab and a screen similar to the following should be displayed (click for larger image).

Screen shot - MyPhpAdmin

As per the image above, select all tables and check the entries as indicated. Make sure to check "save as file" and select compression mode required.

At this point click the "Go" button and your download manager or save as file dialog should appear. Under my system (firefox) the following appears.

Screen shot - Download Save Manager

Accept the file, click 'Ok' and an sql file will be created and downloaded to your computer. The file downloaded, is for all intents and purposes, a backup file of your database. This file will be imported into a newly created database at your new host.

Import SQL file into new database

You should now have an SQL file, which is your backup database file, safely stored away in your computer. The next step is to transfer the contents of that file into a new database at your new host.

Firstly, access you new host, navigate to the cpanel pages, then to the database section and follow the prompts to create a new MySql database. Obviously, remember the database name and user name for later reference.

Once created, access phpMyAdmin and navigate to your newly created database. In the example that follows I created a new database named, "newdrupaldb". You will notice that there are no tables created as yet, that is what the following process will do. Click on the Import tab and you should see a screen similar to the following. Click on image for a detailed view

image-0100x500.jpg

At this screen click on the Browse button and a file dialog window should appear. Navigate to the directory where the SQL file resides.

Screen shot - File Dialog Window

You have a couple of options here. Upon downloading the original SQL file, you might as well compress it, if it wasn't compressed in the downloading procedure. As you can see from the image above the compressed version file size is heaps smaller than the original. The importing process accepts an SQL file either in standard SQL format or compressed (ie. zipped) format. It's quicker to upload a compressed file. Either way select the file to be uploaded. A screen similar to the following should appear with the location of the text file filled in.

Screen shot - MyPhpAdmin

Click the Go button to start the uploading process. Depending upon the size of the SQL file, this may take a few minutes, be patient. At the end of the process your screen should be similar to the following.

Screen shot - MyPhpAdmin

You should notice that, in the example above, 66 tables were created. Your imported database may have a different number of tables created and that's purely down to the fact that you may be using more or less modules than me.

That's it as far as the database is concerned. When configuring Drupal later on it will be just a matter of modifying the settings.php file with the database details. Trust me, that's a simple process and will be explained when we get to it.

Addon Domain(s)

As seems to be the case these days most hosts are offering one free domain for your use. Obviously, if you are transferring from another host you already have a domain name registered and you will eventually be changing the nameservers at your domain registrar to point to your new domain. Don't do it now, that is the last step.

In regards to the 'free domain name' accept the offer and use that domain name purely for administrative purposes. I recommend not using the free domain name for public purposes. It's not a good idea for your host to also be your domain registrar (they will be for the free domain name), it only leads to problems down the track should there be any issues with your host. Effectively, your host could hold you to ransom as they hold the key, the domain name registration.

Another little issue with free domain names or think of them as the main account name is that the document root is the public_html folder and that can't be changed. Well it can't for my host, Drupal Value Hosting. What this means is that if you are wanting a clean site, eg. http://mysite.com, (not referring to a sub-folder) then when uploading and extracting the Drupal (or any system) files, by default the top level folder will be something similar to drupal6-2. You would have to rename this top level folder to public_html or move all the folders and files under the drupal-6-2 folder to the public_html folder. Either way, all files are now at the top level folder of your system. Why is this an issue? If you are considering running a few other sites then all of a sudden it becomes very messy at the top level public_html folder as the new sites will need to have their folders mixed in with the Drupal setup. As I said, very messy.

The following assumes that you are not using your one and only so-called free domain name.

You now need to prepare your site for your existing domain name(s). Access your new host cpanel pages and navigate to the Domain section.

Screen shot - Domains

Click on the Addon Domains link and the following screen should appear.

Screen shot - Addon Domains

It is from this screen where you enter your existing domain name(s). Assuming your existing domain name is oldsite.com, that name is entered in the 'new domain name' field. You will note as soon as you've entered that, the document root will automatically be public_html/oldsite.com.

Screen shot - Addon Domains

If you only have one Drupal site then this would be suitable though I recommend against it. Looking to the future, it's far easier to have a specific Drupal folder (under public_html) and all your document roots of all your sites pointing to the one folder. This will be clearer when a 'multi-site' Drupal setup is discussed.

Screen shot - Addon Domains

Change the document root to where Drupal is installed (or will be installed). If the folder isn't yet created, it will be. Note, it must be a sub-folder of public_html. Click the Add Domain button and your entries should be saved. The following screen should appear.

Screen shot - Addon Domains

For an example I also created addon domains for oldsite1.com, oldsite2.com. Returning to the main Addon Domain page will now appear like so.

Screen shot - Addon Domains

You will note that all the newly created addon domain names all point to the same document root directory. This is required for a multi-site Drupal setup.

You should also note that at this point your existing domain names are still pointing to your old host, that will be the last issue to be addressed. We are merely preparing ourselves at the moment.

FTP Accounts

A tool that you will definitely need is a File Transfer Protocol ("FTP") client program. These programs are more or less explorer type programs in which files can be uploaded and downloaded from the server.

There are a number of freely available FTP client programs and here are a few:

In order to utilise an FTP client you must first set-up FTP accounts at your host. I'm assuming that this particular process doesn't require detailed explanation as most likely you would have been using an FTP client at your old host. Suffice to say, that at my host, when creating the addon domain names corresponding FTP accounts were created as well. If this is not the case with your host, simply follow the prompts to create an FTP account(s). Even if automatic and default FTP accounts were created I'd recommend purposely creating an FTP account that purposely points to a specified folder. That folder's sole purpose being to receive uploaded files. Once uploaded, they can be moved to where ever you want.

My preferred FTP client is Smart FTP as that has a server to server transfer of files feature. I couldn't find that feature in Filezilla when I last checked or should I say it wasn't that obvious whether that feature was present. What this means is that with a server to server transfer of files it speeds up the process as the files (images etc) do not have to be downloaded into your computer and then uploaded (a very slow process) to your new host server.

For examples (screen shots) that follow in this guide relating to FTP procedures I'll be referring to Smart FTP. Regardless of which FTP client you choose to use, the concepts are the same, it's just that screen shots and button clicks will be different.

Transferring files

There are a number of ways in which files can be transferred from one server to another. A feature of SmartFTP is Server to Server and is a very handy one at that.

Server to Server

As already mentioned, SmartFTP has a feature known as 'server to server' which basically means being able to transfer files from one server directly to another server.

Fire up SmartFTP and log into both servers, that is, the source (where your getting your files from) server and your destination (where the files are going) server. I'm not detailing every click required to achieve this.

With the program there are a number of ways to achieve the one process, as is the case with any modern software. I'll detail the menu way.

Open the files listed in the source server panel and drag and drop the relevant folder into the lower 'temporary queue' panel.

SmartFTP screen shot

Right-click on the folder name in the 'Temporary Queue' in the bottom panel and select 'Destination' then 'Remote' then your destination folder.

SmartFTP screen shot

At this point your files should start transferring from the old server to your new server, completely bypassing your local computer.

SmartFTP screen shot

That's all there is to it, your files will be transferred.

Another source of information is the SmartFTP site itself. Here is a video tutorial relating to server to server transfer of files.