Website transfer with no down time?!

I know, it’s a nightmare! In general transferring any kind of file could be tricky but transferring from one Web host to another is definitely serious!

Well, few days ago I purchased a reseller plan from Site5 to transfer all my accounts from my old host, QualityHostOnline. Although I was so happy for years of using QualityHostOnline, there was 2 major things that made me move. First lack of a proper platform for Ruby on Rails (yet, since they try hard to bring it up) and 2nd was the 12GB of space Site5 gives comparing t0 2GB I had for only $4 extra per month. I also got a $25 off Christmas offer!

Long story short, I purchased the plan and wondered how I am going to transfer all those files, settings, emails, databases, and etc. Well, googling around gave me an answer but I needed to tweak myself too. Here is how I did it. It transfers files, e-mails, settings, as well as Wordpress databases.

1. Get a host!

Da! You need your new hosting hosting plan. After all that’s why we talk about transferring in the first place. Most hosts nowadays come with cPanel a great control panel for you host. This tutorial is based on cPanel but the scenario might come in handy for other control panel front-ends.

2. Backup, backup, backup!

It’s always important as well as in here. Backup whatever you have before start. It’s good news that the backup you make is the beating heart of this operation.

backupIn cPanl there is a nice backup tool.cPanel backup page
Log in to your old host control panel. In the backup page (figure 1) click on “Download a home directory backup” which I tagged it as #1 in the figure. Store the zip file in a safe place for the next step as well as later reference.

3. Restore

Now login to your new account cPanel. Note that since you domain name (e.g. yourdomain.com) still points to your current (old) host, logging into yourdomain.com/cpanel will take you to same place. In my case since I had this reseller account and I was blessed to have WHM in both sides I could login to cPanel of the new host from withing WHM (e.g. http://OLD_RESELLER:2086/xfercpanel/NEWSITE).

Note: If you could not login to new site’s cPanel before updating nameservers, you have to finish backing up everything (databases, etc.) first. Then you need to update the nameservers thru your registrar and wait till it is populated. This will be the very last step!

Note: Sometimes the cache in your browser or even your ISP could confuse you showing you old stuff. To avoid this either empty your browser cache (CTRL+SHIFT+F5 in Windows and APPLE+SHIFT+F5 in Mac) or somehow trick the ISP or just wait! (e.g. if you are logged in via www.yoursite.com/blahblah, try yoursite.com/blahblah to trick the ISP with missing www.)

After you successfully logged in to new host’s cPanel, navigate to backup page again. this time we are going to restore what we backed up before.

Browse for the zipped file (tar.gz) in restore section (marked as #2 in figure 1) and click on Upload. This might take few minutes depending on your file size.

Note: I didn’t try this upload method for gigantic files. If you have many files like mp3s and video clips online, I’m not sure if your server timeout will allow you to upload a single fat file. You might easily workaround this by moving giants separately.

Once done, browser will list all files that are successfully uploaded. It’s not a very user-friendly approach and you might think something bad happend. Just navigate back and then go home! (by clicking the house icon top-right of the page)

4. Finalize

Important Note: If you have databases to transfer, you need to first read step 5. this means if you have WordPress, Drupal, Gallery, Wiki, or any kind of Web application that has any relation to databases you need to first back them up. If you are not sure about this, find somebody to help you!

Well, after uploading the home file (which contains everything except you databases) you need to change the domain nameservers to the ones that new host provides. You should check with your registrar and your new host on how to perform this step.

You’re done! Your Website should work now.

5. Database(s)

5.1 Introduction

I’m sure most users need this step before step 4. Almost all new Websites somehow are backed by a database. A common example is Wordpress the very well-known blogging platform (I’m using it now!)

Note: I provide you with the most common solution here, phpMyAdmin. All reputed hosts provide phpMyAdmin as MySQL control panel. You might have guessed correctly that it works only with MySQL. For PostgreSQL you can use phpPostAdmin and for others you need to see what facilities your host is providing.

5.2 Backup database(s)

phpMyadmin db exportIn phpMyAdmin open the database(s) you want to transfer. Find “Export” tab from which you can export the whole content of the database. Make sure you select all tables and select “drop table” “complete inserts” and “extended inserts” just like in figure 2.

Also check “save as file” and choose “gzipped” to compress the exported file as much as possible.

click “go” and in the show dialog choose save to store the file in your local disk.

5.3 Restore database in new host

When you want to create a new database in phpMySQL, hosts usually don’t grant the “CREATE DATABASE” permission to it. It means you need to create your database and its user(s) before and from within the cPanel.

To create a new database that is identical with the one working in old host you need to know the old database name as well as the user-name and password. Usually we don’t need host name since it is “localhost” almost everywhere!

In Wordpress in order to get those information we need to find the configuration file “wp-config.php” located in the root folder of Wordpress (depends on your settings). You can either download it via FTP or just find it in the zipped back up file you already created.

Look for the following statements in wp-config.php:

define(’DB_NAME’, ‘XXX’); // The name of the database
define(’DB_USER’, ‘YYY’); // Your MySQL username
define(’DB_PASSWORD’, ‘ZZZ’); // …and password

Get XXX, YYY, ZZZ based on your file and use them to create a new database as well as a user for your database. Do not forget assigning the username all permissions for that particular database.

If you have any trouble doing all that read the cPanel documentation or just contact your host support team.

Well, now that we have the database and user ready, login in to phpMyAdmin. Select the database (XXX in here!) and navigate to import tab.

Note: Once again since you won’t be able to run phpMyAdmin (as far as I know) until you login through your domain’s cPanel (http://yourdomain.com/cpanel) you need to transfer your domain to the new host before you apply the changes with phpMySQL.

Just browse for the database backup file (you made it before) and click on Import. It should execute normally and might take few minutes depending on your file size. Be patient please!

After a successful restore, login to your home page and check if Wordpress is working properly. If you have done all steps carefully it should run with no problem.

6. Summary

Here we saw how easy (although time consuming) is to transfer a fully functional Website to a new host. This scenario applies to other settings too with some tweaks.

Please do not forget to back-up all you have got before doing anything!

If you faced problem after transferring your domain (e.g. your new site show malicious behavior or showing non-sense messages) do not panic, just transfer the domain back to your old host and try to solve the problem on the other side.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon] Sphere It December 24th, 2007

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


    Calendar

    December 2007
    S S M T W T F
    « Nov   Jan »
    1234567
    891011121314
    15161718192021
    22232425262728
    293031  

    Feeds

    Ads to survive

    And the rest...

    Creative Commons License

    Subscribe with Bloglines

    Blog Flux Directory

    Add to Technorati Favorites

    Website Counter