Moving Sites and Applications to Another Computer in IIS 6.0

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1

You can use the metabase export feature to configure multiple computers with the same basic IIS configuration settings. The procedures below illustrate how to create complete metabase templates for porting the World Wide Web Publishing Service (WWW service), or elements of a metabase, to another computer.

The first procedure below creates a complete, system-independent copy of the metabase configuration and saves it to a file. The file can then be imported to other IIS 6.0 servers without overwriting or conflicting with settings on the target system. The second procedure below creates a template for importing elements of a configuration to another computer.

Important

You must be a member of the Administrators group on the local computer to run scripts and executables. As a security best practice, log on to your computer by using an account that is not in the Administrators group, and then use the runas command to run your script or executable as an administrator. At a command prompt, type runas /profile /User:MyComputer</STRONG>Administrator cmd to open a command window with administrator rights and then type cscript.exe ScriptName (include the script's full path and any known parameters).

Procedures

To port an entire system-independent metabase configuration to another computer

  1. Open a command prompt, and switch to the systemroot\system32 directory.

  2. Type cscript iiscnfg.vbs /export /f path**\filename.xml /d** password /sp, and press ENTER.

  3. Copy the .xml file you created to a temporary directory on the target system.

  4. On the target system, open a command prompt and switch to the systemroot\system32 directory.

  5. Type cscript iiscnfg.vbs /import /f path**\filename.xml /d** password /sp / /dp / /children /inherited /merge, and press ENTER.

  6. Before relying upon the imported elements in a production mode, test your computers after importing metabase elements.

To port metabase elements to another computer

  1. Configure an IIS server to the state that you want ported to other computers.

  2. Export a metabase element to a file, either using IIS Manager; the Exporting IIS Configurations Using Iiscnfg.vbs that is included with IIS; a custom script using the IIsComputer.Export method of the Windows Management Instrumentation (WMI) provider for IIS or the Export method of the Active Directory Services Interfaces (ADSI) provider for IIS; or a custom application using Admin Base Objects (ABO). For more information about these methods, see Using IIS Programmatic Administration in the IIS Software Development Kit (SDK) on MSDN.

    Note

    IIS Manager includes inherited settings by default. If you are not using IIS Manager, you can specify the inherit flag if you want to include all inherited settings.

  3. Clean up the export file by removing or changing all the machine- and system-specific information, and removing all other settings that you do not want applied to other computers. The cleaned-up export file becomes your import file.

  4. On the new computers, create any physical folders that are needed for site and virtual directory paths, copy any content files (.asp files, ISAPIs, and so on) that need to be ported, and register any components that were copied over.

  5. Import your file onto each computer to which you want to apply the settings. Make sure to use the merge flag if you do not want settings in the import file to overwrite any existing settings on the computer. Choose the inherit flag if you used it to create the export file.

  6. Before relying upon the imported elements in a production mode, test your computers after importing metabase elements.