How to change hosts without any downtime, step by step

A common question asked in the various online discussion forums nowadays is “How do I shift/change hosts without any downtime?”. Well, here’s how to do it, step by step.

  • Step 1 :
  • First, add your domain to the control panel of your new host. This way, you’ll ensure that their name servers are updated with your domain’s information, when you point your domain to your new host.

  • Step 2 :
  • Put your site in read-only mode or maintenance mode. This way, you can ensure that your content do not change while you shift your files. Put up a short message informing visitors of the shifting of hosts. If your site consists of static HTML files, you do not need to worry about this.
    Note : Most forums have an option for turning on the maintenance mode. For a WordPress blog, you might consider using the Maintenance Mode plugin.

  • Step 3 :
  • Next, backup everything : your databases, files. If you use cPanel, use the Backup feature to backup your files and databases. You might also request your current host to backup your databases and files for you and they should probably do it. You can also manually download all your files using an FTP client and backup your databases with tools like phpMyAdmin.

  • Step 4 :
  • Now upload the files into your new web host’s webspace. Most hosts provide a way of uploading your files and databases and view your site before the DNS changes propagate. However if your host does not provide you any such a way, you can take help of a little trick.
    Note : This would not work unless you have performed the instructions in step 1 of this guide.

    Take a note of your new host’s name servers. Let’s say, they are ns1.newhost.com and ns2.newhost.com. Now let’s query those name servers about your domain using the nslookup utility. Go to Start>Run and type in the following :

    nslookup yourdomain.com ns1.newhost.com

    Replace yourdomain.com with the name of your domain.
    The query should output something like this :

    Server: ns1.newhost.com
    Address: XXX.XXX.XXX.XXX

    Name: mydomain.com
    Address: 1.2.3.4

    Take a note of the IP address of mydomain.com. Now, go to ‘C:\WINDOWS\system32\drivers\etc’ and open the file named ‘hosts’ with a text editor. On a new blank line, add the following lines :

    1.2.3.4    yourdomain.com
    1.2.3.4    www.yourdomain.com

    Replace yourdomain.com and 1.2.3.4 with their real-life equivalents.

    Now your domain will be pointed to the IP address of your new host’s server only for you. Now you can upload your files, databases to your new host using yourdomain.com as the URL. After uploading everything, check whether your site is looking as it should and whether it’s generating any errors. If there is any errors or discrepancies, correct them. You should make a minor, but noticable change to your index file at your new host so that you can know if the DNS changes have propagated. After this you should remove the two lines from the ‘hosts’ file that you previously added to it, so that the domain resolves to your old host.

  • Step 5 :
  • Now it’s time to change the DNS record of your domain. First we have to check if your new host’s name servers have been updated with records of your domain. For this, we need to run an nslookup query. Go to Start>Run and type in :

    nslookup yourdomain.com ns1.newhost.com

    If the query returns a non-authoritative answer or a “*** UnKnown can’t find yourdomain.com: Server failed” result, then your new host’s name servers haven’t updated yet. Use the same nslookup query to query the name servers again after some time. Repeat this process until it doesn’t return a non-authoritative answer or gives errors for your domain name. Usually, a name server updates itself every 15 minutes, but there may be exceptions. Now it’s safe to change your DNS records. Change your name servers to that of your new host’s OR change your A records to point your domain to your new host’s server’s IP, whichever you wish. The DNS changes will take around 24 to 48 hours to propagate around the world. You’ll know that the changes have propagated when you notice the minor change in your website which you did in Step 4.

Don’t delete your old hosting account yet. Until the DNS changes propagate around the world, people will go to your site hosted at your old host. It’s usually safe to delete your old hosting account after 5 days.

This pretty much concludes this article. If you face any problems while following the steps above, leave a comment and I’ll gladly help you.

See also : Automated website tools.

The activities of an “in-the-wild” malware

The malware sitting pretty on my desktopToday, out of boredom, I decided to check the kind of spam I receive in my Gmail inbox. Since all the spam emails had the the same kind of spammy-attractive titles, I decided to check the first one, succulently titled “Video Paris Hilton Nude !”. The email had a conspicuous hyperlink with an H1 anchor text to a file “video-paris-hilton.avi.exe“.(Notice the .exe at the last).

Like an unsuspecting average Joe, I decided to download the file and see what it has in store for me. I scanned the downloaded file with Kaspersky Antivirus and it failed to detect any rogue code in it. So, I decided to run it and see what it does. It’s actions seemed innocuous at first. Double clicking it generated an error :

Error

Feeling kind of dissatisfied, I continued with my work. After a few minutes, suddenly, my wallpaper changed to this :

And I got a warning from KIS that the malware was trying to access the internet. I promptly blocked it.

Now, my first action was to try and change the wallpaper. But I found the ‘Desktop’ and ‘Screensaver’ tabs missing from the Display properties window.

But I’m not the one to easily give up. I did some research and found out that the malware had disabled the Desktop and Screensaver tabs by modifying some registry entries, namely ‘NoDispBackgroundPage’ and ‘NoDispScrSavPage’ from ‘HKEY_CURRENT_USER\Software\Microsoft\Windows\Current Version\Policies\System’. It had modified it’s value from 0 to 1; which had disabled them.

I re-modified the entries to their default values and got back the Desktop and Screensaver tabs in the Display properties window. Then I changed my wallpaper to the previous one.

On the next reboot, I found that the malware copies itself to the ‘C:\Windows\System32\’ as lphcvtmj0ejdn.exe, and creates an autoloading entry in the registry which will run the malware on every reboot. I removed the entry from ”HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam\MUICache\” and deleted the file from the ‘system32’ folder.

I’ve already sent the malware to Kaspersky Labs for analysis. I’ll update this post when I hear from them.

Update : Response from Kaspersky Labs :

Hello,

video-paris-hilton.avi.exe_ – Trojan-Downloader.Win32.Small.aboa

New malicious software was found in this file. It’s detection will be included in the next update. Thank you for your help.

Please quote all when answering.


Best regards, Vyacheslav Zakorzhevsky
Virus analyst, Kaspersky Lab.
e-mail: newvirus@kaspersky.com
http://www.kaspersky.com/

All’s well that ends well!

Making the Woopra analytics code valid xHTML

Woopra is a ground-breaking web-analytics service that is seriously better than Google Analytics. However, the default javascript code is flawed, in the sense that it doesn’t validate as xHTML strict.

The default code looks like this :

[js]<script type="text/javascript">
var woopra_id = ‘XXXXXXXXXX’;
</script>
<script src="http://static.woopra.com/js/woopra.js"></script>[/js]

where ‘XXXXXXXXXX’ is the website ID.

To make this valid xHTML, you just need to add type="text/javascript" to the second script tag; so that your code looks like this :

[js]<script type="text/javascript">
var woopra_id = ‘XXXXXXXXXX’;
</script>
<script src="http://static.woopra.com/js/woopra.js" type="text/javascript"</script>[/js]

PS : Those of you who are using the Woopra WordPress plugin, you don’t need to worry about this. The plugin produces the valid xHTML code by default.

Start My Computer with Folder view activated

By editing an entry in the registry, My Computer can can be started with the Folder tree activated. Normally, this can be activated by clicking the Folders button above the address bar; but if you use the folder view frequently, you might wish to permanently activate it.

  • Click on Start>Run.
  • Type in regedit. This will open the Registry Editor.
  • Navigate to the HKEY_CLASSES_ROOT\Folder\Shell key.
  • In the right pane, right-click on the (Default) string value and select Modify.
  • Type in explore the the ‘Value data’ field.
  • Click on “OK”.

Note : This hack only works for Windows XP, Me, 2000, 98. I haven’t tested it on Vista though.