whenpenguinsattack.com

Saturday, January 07, 2006

Successfully Backing up and Restoring IIS 6.0

There comes a time in every system administrator's life when they must face a harsh reality. Your company's webserver has had a major harddrive failure and it needs to be running again as quickly as possible because in the business world, time=money.

After personally going through the above scenario a dozen times, I scoured the Internet to
find the best solution for backing up and restoring all of my company's websites. Microsoft provides a few solutions within their knowlege base, but most require you to restore it on the exact system (hardware) where it was backed up.

I came up with a solution that is fairly simple to execute and is hardware independent.

Disclaimer: I have tried the following and it has worked successfully for me, but use it at your own risk. I am not responsible for any damage you may cause from following this procedure.

Steps for backing up (These steps will be done on the original server)

Step 1: Download and Install the iis 6.0 resource kit (link here)
Step 2: We are first going to backup the metabase files for your server. This is a sort of internal registry designed specifically for IIS.
A) Launch the program called "Metabase Explorer" that came with the resource kit
B) Two items can be seen on the left-hand pane. "Lm" and "Schema". Both of these need to be saved. To do this, right-click on each one individually and then go to "export to file". To make it easier for restoring, I prefer to use the exact names of each key: "Lm.mbk" and "Schema.mbk". If you don't use this naming convention, just remember the file that is associated with the proper key.
C) Now, the actual websites can be backed up. There is nothing special that needs to be done here. The entire website directory just needs to be copied to your desired location. Also worth noting: remember the exact path of your websites directory. IE: "C:\websites" or "c:\wwwroot". You will need this when restoring.

Steps for Restoring (These steps will be done on the new/target server)

Step 1: Copy all website files from the backup to the exact filepath as the original server (from step 2 part c from above)
Step 2: install the iis 6.0 resource kit
Step 3: launch the metabase explorer
Step 4: left-click on "LM" on the left-hand pane and go to metabase->import key. Then point it to the LM key file that has been backed up.
Step 5: Follow step 4 for "schema".
Step 6: This step is important, because without it, your websites will be inaccessible. If this step is forgotton, you will see a username/password authentication box whenever someone tries to visit any of your websites.
A) Open up the IIS manager
B) In the left-hand pane, right-click websites and go to properties.
C) Go to the tab that says "directory security"and under "authentication and access control" click on "edit".
D) The restore process clears these settings, so make sure "enable anonymous access" is checked and an username/password is set. It will not allow a blank password, so a password will need to be set for the anonymous user account on the system username: IUSER_*MACHINE NAME*. This can be done through the administrative user control panel.

You should now have an exact copy of your websites.

2 Comments:

  • Great post - VERY useful. I've been looking for something like this for an eternity so a big thanks for actually taking the time to post this!

    One comment though - since the export of LM and Schema basically copies the entire Metabase what about the likes of Application Pools or FTP accounts, etc, all of which would be included in the export?

    I wonder (in a similar manner to making sure the allow anonymous access is reset) if similar tweaks would be required for such settings to be transferred without error? (Here speaks a man who wants to cusually ask you rather than bugger up his own IIS installation!).

    Anyway - thanks again for the info.

    By Blogger Katatomic, at 8:23 AM  

  • Very, very useful

    By Anonymous Anonymous, at 8:34 PM  

Post a Comment

Links to this post:

Create a Link

<< Home