aaronholdingexclamation.gif

Migrating Your Website

July 29, 2008

by Matt Hedges

Many people regularly pop up the question of moving to another web host or IP address without having any kind of hiccups in Google. I completed a successful test of moving mattcutts.com from one IP to another by changing the host, which I will share with you. if you have a static website or you can spare a day when your website can oscillate between 2 IP addresses, it would be easier, but if your website is a dynamic one, things will be a bit difficult for you, though the concept remains the same. Let’s go through the steps involved in this.

Step 1: Sign up with a good web host provider

You can do some research work or follow some references to find a good web host for yourself. I preferred by present web host (csoft.net), which I selected after research, and I also found that the readership of the site was growing beyond my expectation. A non-SEO friend of mine used pair.com. Let me refer to the example using IP addresses. If we move from csoft.com to pair.com, the IP would change from 63.x.x.x to 65.x.x.x. DNS is a system used for mapping websites to the IP address which a machine uses, like, say, 61.115.6.132.

Step 2: Create a backup of your website on the new web host

Having a static website is good as it would just mean copying the whole file to the new web host - that’s it. But having a blog is a bit hard since it generally involves MySQL for storage of posts. Some e-Commerce sites are more difficult for this purpose as the database is always synced over there. In such a case, you might have to set up a replica of the database between the old and the new location during the transition.

Let’s cite an instance of a WordPress blog using MySQL database which can afford to be down for a couple of hours with little problem. Firstly, assume that you have used the FTP or tar for copying the static files from one web host to the other. You then need to create a fresh MySQL database on the new host. Normally, you can give the same username and database name. If not, then make sure you tweak the WordPress wp-config.php on the new location for updating the username, database name, and other relevant things.

You now have a new SQL database so that you can get away with the old one, copy it to the new one, and then load the database there.

One has to bear in mind that it’s not only about a username and a password for both the web hosts but it’s about having dissimilar usernames and passwords for the database at every single location. I exhibited the host option while database reinstatement because you can be endowed with MySQL database stored on a distinctive location. In fact, WordPress can’t get into the database if notwithstanding the new host having a unique option for the database, you don’t edit wp-config.php file.

At two separate locations, you do have the same copies of your website. The issue of maintaining both the databases synchronized is only applicable to the vast and e-commerce based site. Whereas, someone altering your database at the transition period or a comment getting posted is nothing serious provided your blog is endowed with update of some comments regularly.

Step 3: Changing the DNS to point to the new web host

This is the main thing to achieve. Let me give some fair idea on DNS first. Whenever Googlebot or anybody attempts to reach your site, they look your IP address. They do their best make sure of the authenticity by rechecking the IP address after about 500 fetches, or even check whether certain number of hours have elapsed. Normally, people using DNS-enabled browsers are affected by TTL [a setting - Time to Live], which is measured in seconds and says “The IP address you fetched will be safe for ‘x’ seconds; you can cache this IP address and not bother to look it up again for that many seconds.” Obviously, since if you tracked the IP address for all the content on each webpage of your site, the browser would move very slowly indeed.

For DNS, TTL assumes a significant role. A couple of websites like Google, Yahoo!, MSN, etc. have pretty short DNS TTL setting of about 300-900 seconds. This is because if you have many data centers, you would like to take one of them down to enable the data center mechanics to provide good data to the machines. If you have a short TTL, you would be able to pull the IP address of a data center out of the rotation in merely a couple of minutes.

This also explains the days of “Google Dance” that went by. It would last for a week or so, and based on the data center which the user hit, they would see the old as well as the new results. The main reason was that every data center was brought down and brought back, after loading it with new data. It required many days to switch the data to all the centers. During the period, webmasters checked out www2.google.com or www3.google.com since they led them to the latest data centers. Nowadays, the production system is properly equipped for switching these things around in lesser time.

Step 4: Wait while the DNS change is propagated through the internet

This is a TTL function and is based on whether you are switching to those name servers which are present in the DNS currently. DNS is hierarchical, and thus it will take some time for the DNS caches to be flushes as the TTL is exceeded. The switch, which takes place at the root of DNS, would be faster only if you use a smart registrar and a known set of the new name servers. The ‘dig+trace domain’ can be used in UNIX and Linux for confirming that the new name server is present on the root server.

Step 5: If Googlebot is fetching from the new web host and the IP address, the process is almost over and one can shut down the previous website.

You can check your IP address by pinging your domain. The old visitors might be using the old IP address from their own DNS cache, but the new visitors should be getting the new one. Some people have a long TTL set, and they should be allowed two days. After that, you can deactivate hosting on the old location. You can check your logs for a fail-safe confirmation of this. When your log mentions no one visiting from the old location, your work is fully done.

About the Author:

Comments

Comments are closed.

Add to Technorati Favorites

123 Aaron Feedburner Site