web-developer
HomeWindows/IISDHTMLRankingIndex ServerContact me 
 


 
Source: IIS FAQ

Backup & Restore of the IIS Metabase - What tools can I use?

The backing up of IIS involves the backup of the IIS Metabase. The IIS Metabase is a database similar in structure to the Windows Registry. The IIS Metabase is optimized for IIS and provides a hierarchal storage and fast retrieval of IIS configuration properties for Web sites, Virtual directories, FTP Sites, SMTP and NNTP sites.

To learn more about the IIS Metabase objects and properties go to this URL:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iisref/html/psdk/asp/aore94th.asp

There are a number of ways to backup the Metabase and some are better than others when we look at it closer:

  • IIS Backup/Restore option in the Internet Services Manager snap in.
  • IIS Metabase Editor to Export/Import the Metabase to a text file.
  • ADSI command line script.
  • Third party utilities.

IIS Backup/Restore option in the Internet Services Manager snap in.

The Internet Services Manager snap in contains a backup & restore option that can be accessed by right-clicking the * Computername node in the MMC. On this menu you will see a Backup/Restore configuration option. as shown below.

.

Selecting the Backup/Restore configuration menu item will open the following dialog where you can elect to backup the Metabase, restore a recent backup of the Metabase or delete a Metabase backup from the list of previous backups.

 

Clicking Create backup... will open the following dialog which asks for a backup name. This backup name is something you can use to remember the backup by.

After you click OK the backup is performed and the Configuration Backup/Restore dialog is updated with the details of the backup including the date & time of when the backup was performed.

The backup is stored in the \Winnt\System32\InsetSrv\Metaback folder on the IIS computer.

You can also backup the IIS Metabase using ADSI which is a programmatic way of performing the above backup. For more information on ADSI backups of the IIS Metabase see this article How do I backup the Metabase using a script?

Right now you are probably think thinking that this is very good an easy to do and I have a nice backup of my IIS Metabase. Well this is true but with one very large caveat!

  • The Metabase backup can only be restored to the current machine.
  • The Metabase backup can not be restored after Windows is reinstalled!

This makes the IIS Metabase backup only good for day to day backups where you may accidentally delete a web site or virtual directory, or something goes wrong while working on an ADSI script, or while using the Metabase Editor.

So what options do I have if I want to restore the Metabase after a full system reinstall? The next topic should help you in this situation.

IIS Metabase Editor to Export/Import the Metabase

As I mentioned earlier the IIS Metabase is like the Windows registry and like the registry there is a tool that you can use to make modifications directly to the Metabase properties.

WARNING: Using the Metabase Editor incorrectly can cause serious problems that may require you to reinstall your operating system. Microsoft and www.IISFAQ.com cannot guarantee that problems resulting from the incorrect use of Metabase Editor can be solved. Use Metabase Editor at your own risk.

Now that we have that warning out of the way I would suggest if you do make modifications to the IIS Metabase that you perform a backup prior to making those modifications.

The image below shows you what the IIS Metabase editor looks like; for more information on downloading the IIS Metabase editor see the following Microsoft KB Article.
http://support.microsoft.com/support/kb/articles/Q232/0/68.ASP

The Metabase editor can be used to export Metabase properties to an ASCII text file that you can use to restore the settings onto either another computer or a computer that has just been re-installed.

On the Metabase menu item in the IIS Metabase editor there are options to export and import the Metabase settings.

  Export the selected item in the tree and all child objects to a ASCII Text File
Import a previously exported file and restore all content
Export all FTP Sites to a ASCII Text File
Export all Web Sites to a ASCII Text File
Run the standard IIS MMC Backup/Restore
Exit the Metabase Editor.

Export the selected item in the tree and all child objects to a ASCII Text File

This option will allow you to export a particular Metabase entry and all child entries to a text file. For example if you wanted to export one specific web site you would select the Instance ID of that web site and then select the Export Text File... option. 

Import a previously exported file and restore all content

This option will allow you to import a previously exported Metabase text file. The import function can overwrite any existing settings in the Metabase and you should perform a backup first. You have the option of importing the file to the original location where the data came from or a child key of the current node.  Importing to a child key of the current node is not very useful as the following dialog shows.

Export all FTP Sites to a ASCII Text File

This option will export all FTP sites to a text file, this includes all properties for all of the FTP sites including the MASTER FTP properties.  

Export all Web Sites to a ASCII Text File

This option will export all Web sites to a text file, this includes all properties for all of the web sites including the MASTER WWW properties.  

Step by Step - backing up one specific web site and restoring it. 

  • Open the Metabase editor (The editor is accessible by default in the Administrative Tools folder) 
  • Navigate to a web site Instance ID under LM\W3SVC. The Instance ID of 1 is always the Default Web Site, but any others are dependant on your configuration. If you are running IIS on Windows 2000 professional you only have the default web site.
  • When you have selected an Instance ID go to the Metabase Menu and select Export Text File...

  • You will see this dialog after you select Export Text File..., the web site you export will temporarily disable the web site application so it is not something you want to do to a busy site or during times of high activity (This is one of the largest problems with this export). Select Yes to continue


  • You now need to enter a filename for the export file and click the save button


  • After clicking save you are shown another dialog that explains what you are doing.

    In my case I am exporting to a file called c:\test\Export Of Metabase using MetaEdit 2.2.txt from the Metabase path of LM\W3SVC\1 which is my Default Web Site. Click Yes to confirm this action.

     
  • The application is then temporarily disabled and the export is started, at the end of the export the application is restarted and you will see the following completion dialog.



  • We have now successfully exported the Default Web Site to the file c:\test\Export of Metabase using MetaEdit 2.2.txt

Restoring the Web Site we just exported

  • Open the Metabase Editor
  • Make a change to the web site properties that we just exported. You can use the Metabase editor directly or if you feel uncomfortable use the Internet Service Manager. In this sample we changed the ServerComment property which is the description of the web site.

    I navigated to the LM\W3SVC\1 key in the Metabase editor and Dbl-Clicked on the ServerComment property and modified it to say "Data Changed - Default Web Site"


     
  • You can refresh Internet Service Manager now to see the modified default web site name. If you made the change in the Internet Service Manager you will need to refresh the Metabase Editor properties. You can do this by pressing F5.
  • We now will import the exported web site properties and overwrite the change we have just made.
  • Select Import Text File... from the Metabase Menu.  You will get the following dialog, you should read what it says and then click Yes

  • Select the file to import - it must be a Metabase export file and click the Open button.



  • You are now shown another dialog that asks you to confirm that you want to import the file and restore the contents to the same location it came from; in my case it was LM\W3SVC\1 which is my Default Web Site. 

    If you choose Yes then the current settings (if they exist) will be overwritten with the data from the import file; if you choose No then the settings will be restored to a child key of the selected item in the Metabase Editor.

    If you restore to a sub key you will find that the full path is restored to a sub key. So in our sample if we restore to LM\W3SVC we will end up with LM\W3SVC\LM\W3SVC\1 which is not very useful.(as shown in a prior dialog above)



  • In this case we will import and overwrite the existing settings.
  • You are now shown another dialog that asks you to confirm your selections and it shows you the current action that will be taken if you proceed
  • If you do choose Yes then you will be shown another confirmation dialog, explaining that you should do a backup first (which you should - the standard backup available in the Internet Service Manager or the Backup/Restore option on the Metabase Menu is good).

    It also explains that you are going to import the data to the original locations stored in the Metabase.



    Selecting No will store the imported data at a sub key of the currently selected Metabase editor item. Check the currently highlighted entry in the Metabase editor before restoring the file. Remember that restoring to a sub key means that the full path is restored to the sub key as previously mentioned.
  • If you click Yes the import will start with no more prompting. The current application is disabled (if it exists) and the import proceeds. The application is then restarted after the import.

    So go ahead and click Yes to start the import.
  • At the end of the backup you will see the following dialog and your web site is restored.

  • This is a good tool but I am not sure I like the disabling of the application. If it a quick way to transfer web sites and ftp sites and other data to a different server.

How to backup the IIS Metabase using an ADSI script

This following article contains detailed instructions and a script that can be used to backup the Metabase.

http://www.iisfaq.com/Articles/70/

Third party backup tools

  • IISFAQ.COM script generator - This script generator writes a commented VB Script using ADSI that will regenerate one or more web sites. Currently this tool is still in development. The tool will be released with source code and will be freeware.
  • IIS Export at http://www.adsonline.co.uk/IISExport/ allows you to export the data to a database and restore the data to another computer or the same computer.

Note: If you know of any other 3rd party IIS backup/restore tools please let me know and I will list them here.

IIS Export Utility

This is a useful Shareware app that we've put together. In a nutshell it's used to transfer web sites from one IIS4/5/6 (Microsoft Internet Information Server version 4, 5 or 6) server to another. It keeps in tact all read/write permissions, virtual directories and a host of other options and settings. It will even copy the content of your web sites too!

 

Some user comments :

This application is wonderful - congratulations to all the clever people who wrote it. Thank you for all your help.
Stephen Walker, Liverpool John Moores University.

"Until recently, no one had designed a utility specifically to achieve duplication of an IIS setup from one server to another, with no clusters or enterprise required. So I was delighted when I ran across a company offering a utility that does exactly that, complete with virtual directories and other settings. To make the utility even sweeter, it's freeware. The utility even has a feature that lets you save the settings to a database and restore them later to another system. Check it out"
Brett Hill - IIS Administrator column - Windows 2000 Magazine
Read the full article - http://www.microsoft.com/TechNet/prodtechnol/iis/support/admin200.asp?frame=true

 

 

IIS Export Utility FAQ
FAQ version 2.0

 

The latest version of this document can always be found at http://www.adsonline.co.uk/IISExport/documentation/FAQ.htm

FrontPage server extension considerations
The IIS Export utility can only transfer settings from IIS4/5, and therefore cannot transfer any transactions from Microsoft Transaction Server(MTS), or setup FrontPage Server Extensions as you previously had them. For this reason, if you used FrontPage Server Extensions you will have to re-load these onto your sites.

In the IMC your site will still display FrontPage Web with or without the tick as you had it previously. However, the FrontPage Server Extensions will not be added on. To do this, use the FrontPage Server Administrator, which is located in the same program group as IIS on your start menu. Follow the guides set down in the troubleshooting section of the IIS Export documentation.

IMPORTANT SECURITY NOTE
If you copied the files for your web sites using Windows Explorer, not all of the permissions may have been copied correctly. This will lead to serious security holes if you install FrontPage Server Extensions. To fix this problem, Uninstall the server extensions after you have loaded them, and re-install them again. Now stop and start the web services for the changes to take effect. This deletes the automatically created FrontPage directories which may have security problems, and re-creates them with the correct permissions. If you used the SCOPY utility, or directory replication this should not be a problem, but better safe than sorry!

Always check your site for FrontPage security!
Use a copy of Frontpage (using Frontpage 2000 or Frontpage explorer for versions <=98) to connect to your site and make sure you are prompted for a password. IIS is not always very good at setting Frontpage security when it adds a new site, which is the process when IIS Export re-creates your sites.

Alphas
At present our utility is not designed to run on Alphas. However, it may be possible to use with Alphas if you also have an i386 box with IIS4/5 installed. The following method has been reported to work, but we ourselves have not had opportunity to fully test.

As the IISExport utility only needs to be installed on 1 machine (and this doesn't have to be either the source or target machines), install IIS Export onto an i386 box. You should be able to specify the name of the Alpha servers in the Import/Export boxes and use the i386 box as a transport.

The following have been reported to work :

  • Intel -> Intel
  • Intel -> Alpha
  • Alpha -> Alpha

What machine(s) should I run IIS Export on?
You will need a machine to export from and a machine to export to, both with IIS 4/5 installed. You don't have to run IIS Export on either of these machines however, so if these are mission critical servers that cannot have any software loaded onto them you can install IIS Export to a third machine. IIS Export must be installed on a machine that also has IIS on it. See next section for extra notes.

What versions of IIS can IIS Export transfer?
IIS Export can transfer sites between IIS 4 and/or IIS 5. Very few IIS 5 servers will be able to connect to IIS 4 servers so you may have to run IIS Export from the IIS 4 server. 

Can I use IIS Export to backup my sites?
IIS Export can store your IIS configuration in a database file which can be backed up and restored at a later date. It can also be run as part of a backup routine by using the RUNBACKUP command line option and scheduling execution using the windows scheduler service.

What are the shareware limitations?
There is only one, you can select/export/backup only one site at a time in the shareware edition. All other functions are the same. If you can't work the shareware version then you won't be able to work the registered version. The registered version allows you to select/export/backup multiple sites as a time, this is the only difference.