Clicky

X

Subscribe to our newsletter

Get the State of Digital Newsletter
Join an elite group of marketers receiving the best content in their mailbox
* = required field
Daily Updates

Migrating from Shared to Dedicated Hosting

13 November 2013 BY

89 Flares Twitter 60 Facebook 6 Google+ 6 LinkedIn 10 Buffer 7 Email -- StumbleUpon 0 Pin It Share 0 Filament.io 89 Flares ×

For many smaller sites shared hosting is perfectly capable of providing an acceptable experience to its users, but what happens when a site begins to grow? That’s when either virtual dedicated or full dedicated hosting comes in. Here we cover the process of simply moving from shared hosting to dedicated with no downtime and minimal disruption to a business.

What’s the difference between shared, virtual and dedicated?

Shared Hosting

Shared hosting is by its very name a server that has its resources shared across a wide number of websites. On a typical shared server there may be hundreds of other websites eating away at valuable resources. You have no control over a) the content of these sites and b) the way the sites are coded, this can lead to a number of issues:

  • The content of any number of the sites could lead to the whole IP address being blacklisted by search engines
  • The way any of the sites are coded could put a significant drain on the already spread-thin resources the server has leading to unexpected downtime

Shared hosting is typically ok for hyper local businesses and small blogs with limited traffic. As I stated earlier though it’s a great, cheap starting point, but where to go when your site/business beings to grow?

Reverse IP Screenshot

Virtual Dedicated Hosting (Virtual Private Server, VPS)

When shared hosting is no longer enough for your website, the next logical step in the ladder is a virtual private server (VPS). Virtual private servers are run in groups in a virtual environment on a larger, more powerful dedicated server. The way that VPS differs from shared hosting is that despite still being a shared environment many of the resources are specifically allocated to each VPS. This means that if your host guarantees you 2 processing cores, 50GB hard disk and 2GB of RAM this is what is allocated to you to use on the server, no one else can touch these. What is shared then is everything else such as bandwidth.

Another advantage of VPS hosting is the fact that you get your own IP address with your server. This means that you are in full control of how many websites are hosted on the IP and more importantly the content of the websites.

Sounds perfect, right? Well kind of. Whilst a VPS is a massive step up from shared hosting there are still things to consider:

  • CPU and RAM are virtualised. What this means is that they are delivered in blocks, so intensive scripts that are not set up correctly may still struggle to process correctly.
  • Most VPS packages are un-managed. This means that you will either need some technical knowhow to manage a server environment or hire in the skill.
  • Cost. Whereas a shared server can come in around £2 a month you will probably be looking at ten times the amount for a starter VPS package.

Dedicated Hosting

Having gone to all the trouble of defining what the other types of hosting have and do not have you should have an idea of what dedicated hosting will offer you. Dedicated hosting is exactly as it sounds. You buy or lease an actual server from a hosting company, install your own software and manage it yourself. All of the resources of the box are fully allocated to you and you are free to do whatever you want with the box.

You can install any software that the specification of the server can handle and it should run like a dream, the only limit to the resources available is your budget. Dedicates servers can run from the hundreds of pounds per month to the thousands depending on your needs.

The Move

There will come a time that most businesses that host their websites on a shared hosting package will need to move to either VPS or dedicated hosting and luckily the process for both is almost identical. Here I am going to cover moving from an Apache Linux shared hosting to an Apache Linux VPS box for no other reason than it’s the technology that powers over 45% of the web (http://news.netcraft.com/archives/2013/10/02/october-2013-web-server-survey.html) and the technology that powers 100% of the sites I build.

Things to consider

  • When making a server move there will need to be a ‘change freeze’ period. This means that all website stakeholders and editors will need to be notified that beyond a certain time and date no changes should be made to the live site, either through the content management system (CMS) or FTP. Login details should be changed after this point to prevent accidental changes.
  • When moving emails, after the DNS update (covered later (link to section)) there may be some emails that go to the old server and some that go the new server. This period should typically last no longer than 24-48 hours.
  • Your choice of website platform (WordPress, Magento etc) might require specific changes to be made as server paths will probably change (covered further in this post)

Setting Up Your New Server

Heart- Order VPSStep 1. The platform we are using here is Heart Internet, but many providers will have a similar workflow. First we have to select the specification of server we want and click order.
step2Step 2.With Heart we now get a server status page that will show us when the server is installed and ready.
Step 3. whm-installOnce ready we can now login to the WHM install at http://IP_ADDRESS:2087 – Here we will complete the installation by accepting the terms and conditions and setting some values.
step4-create-new-accountStep 4.We are now presented with the WHM home screen, where we select ‘Account Fucntions’ -> ‘Add New Account’.Fill in the details as required, making sure to make a note of the generated password.
Step 5. You now have the hosting account set up and ready for use.

Moving Files

This part of the process is possibly the easiest, longest and most important. Moving files is as simple as making a full backup of all of your files on the shared FTP server and copying them to the new server.

Your login details for the new FTP account will be as follows:

Host:                     IP Address of server
User:                     Username given on account set up, in our case sitemigr
Password:           The password set on account set up.

The folder that files should normally reside in is usually either /www/ or /public_html/

Tip: I suggest using Filezilla (https://filezilla-project.org) as it has a handy ‘Failed Transfers’ tab that notifies you of any transfer errors. You want to make sure you have transferred each and every file.

failed-transfers

Creating & Moving Your Database

Assuming your website uses a database to power its content management system you will need to migrate it from the old server to the new one. cPanel provides a simple MySQL database wizard the will allow you to create a database, a user and give the user write privileges. I cover using the MySQL Database wizard in the following video:

The next step after we have our database ready to accept data is to move our data across. There are a few different ways this can be done, but in the following video I cover using phpMyAdmin as this is provided with most shared hosting and is included in cPanel.

Once your databases are moved you will need to update your configuration files for your web app (WordPress, Magento etc.). Please see specific instructions on the specific app’s support site,

Special Considerations

“When migrating a Magento site there are a number of things that you should consider. The first thing to do is make sure the site is in maintenance mode and stop any cron jobs from running. This ensures that you don’t lose any order data between the time you take the database dump and when the site goes live in its new environment.

Secondly, once the files and database have been moved make sure to update the database details in your local.xml and (this bit is essential!) delete the contents of the var/cache and var/session folders. Without this your visitors will be seeing the site based on the cache files that were generated on your old hosting environment, which can cause all sorts of problems.” James Sims, PushON Digital

 

The last (but not least) thing to remember is to make sure the file permissions are set correctly on your new server. To get things running you can run the following commands from your Magento root folder:

find . -type f \-exec chmod 644 {} \;

find . -type d \-exec chmod 755 {} \;

find ./var -type d \-exec chmod 777 {} \;

find ./var -type f \-exec chmod 666 {} \;

find ./media -type d \-exec chmod 777 {} \;

find ./media -type f \-exec chmod 666 {} \;

chmod 777 ./app/etc

chmod 644 ./app/etc/*.xml

Ideally you will not have any folders set to 777 as it is a potential security issue, so once you have the site running you should set up the user and group permissions on the var and media folders manually in a way that lets the site write to these locations.”

WordPress

There are a number of steps that should be followed when moving a WordPress site.

  1. Move the database as per the previous section
  2. Update wp-config.php with the new database details
  3. Clear any caching plugins you may be running (W7 Cache etc.)
  4. Run a crawler such as Screaming Frog to make sure there are no broken links/images

There are a few extra steps if you are also taking the opportunity to move domain name. Before you export the database navigate to Settings > General and update WordPress Address and Site Address to the new URL. Now continue as above.

Screenshot 2013-11-07 19.41.45

Once you have the website setup on the new URL install a plugin called Blue Velvet Update URLs and enter the old and new domain names. Tick all the boxes and click update. This will update all the URLs in the content, custom fields and images.

Testing

Updating your hosts file

Your hosts file (Windows or Mac) is what tells your computer to use to look for websites. The entries in this file override the DNS provided by your Internet provider. This makes it very useful for testing your website on its new server.

To edit your hosts file you will need to run Notepad.exe as Administrator (right click the program in Start Menu and click ‘Run as Administrator). Open your hosts file from the following location:

C:\Windows\System 32\drivers\etc\

Add 2 new lines to the bottom of the file in the following format:

IP ADDRESS        DOMAIN

So if your new server IP address was 239.456.678.200 and the domain name was example.com the you would add:

239.456.678.200                example.com

239.456.678.200                www.example.com

Save the file and restart your browser (it may be necessary to restart your machine in some cases).

Screaming Frog

I have mentioned Screaming Frog a couple of times in this post but it really is the best tool for finding website errors. Once you feel you have all of your files and databases in place and configured properly, now is the time to test.

Start a crawl in Screaming Frog specifically looking for broken images, broken links, 404’s and 301’s. Fix any and all of the errors you find, if everything has gone to plan then you should have few to no errors.

E-commerce/Website Forms

Another important stage in testing is to make sure that your acquisition channels work, be that a shopping cart or contact form. Test all of your shopping cart (right through to purchase) and forms from multiple machines on multiple IP addresses (different offices).

Make sure that the funnel is the same that it was on the old server, and that all emails are being sent and received correctly.

Updating DNS

Once you are happy that your website files and databases are fully and correctly moved, and that your site is working as expected on the new server, it’s now time to make the final change that associates the server with the domain name.

Updating the DNS will vary from host to host, with Heart Internet it’s as simple as updating A records to have the new IP address.

Screenshot 2013-11-07 19.59.59

Moving Emails

To move your emails from one server to another you can use Thunderbird or Outlook, and I cover using Thunderbird in the following video:

As stated in the video this step is best done after you are sure the DNS has fully propagated, so that you only receive email on the new server and there is no chance of any being lost.

Conclusion

Moving server is not something that should be taken lightly, and certainly in the case of bigger brands and websites should be undertaken by an experienced professional. However I hope I have shown in this post and accompanying videos that with a little bit of forward planning, and care it’s certainly not beyond most website owners when the time comes to upgrade your server.

I must say special thanks to Heart Internet who provided me with a free VPS server for a week to record the videos and take the screenshots.

Guest Author Bio

dan-taylorDan Taylor is founder and Director of Tailored Internet Marketing, a small agency based in the North of England.

Having previously worked at larger agencies in the UK and in-house at MoneySupermarket Dan has a wealth of experience in Search Engine Optimisation, but also has a strong development background. This allows Dan to look at the more technical aspects of search, whilst also drawing on the client side experience to produce watertight strategies.

Outside of search Dan is a family man with three lovely children, a fiance and two dogs. Dan also loves his football with Everton being the team he follows.

Follow Dan at @Tailored_Dan

 

 

AUTHORED BY:
h

This post was written by an author who is not a regular contributor to State of Digital. See all the other regular State of Digital authors here. Opinions expressed in the article are those of the contributor and not necessarily those of State of Digital.
89 Flares Twitter 60 Facebook 6 Google+ 6 LinkedIn 10 Buffer 7 Email -- StumbleUpon 0 Pin It Share 0 Filament.io 89 Flares ×