In the left pane, right-click on My Web Site and select All Tasks To import the previously saved configuration for My Web Site back into the Metabase, do the following:
Open Internet Information Services (IIS) Manager.
In the left pane, right-click on Web Sites and select New Type the path to the saved configuration file or click Browse to select it.
Click the Read File button to display a list of web sites contained in the saved configuration file.
Select the web site named My Web Site and click OK.
Specify a password if prompted and click OK.
Right-click on the web site and select Start to start it.
You can similarly import the configuration for an FTP site, virtual directory, or application pool.
Using a command-line interface
The following command exports the configuration of the Default Web Site to a configuration file named default.xml:
> iiscnfg /export /f default.xml /sp /lm/w3svc/1 /children
Here /sp specifies the source path, i.e., the metabase key, you want to export. In this case, I used /lm/w3svc/1, which represents the Default Web Site (site ID = 1 under the W3SVC service). The /children option recursively exports subkeys (child keys) as well.
This command exports the configuration of a site with ID number 66485902 and password protects the export file so you can import it onto a different IIS computer:
> iiscnfg /export /f anothersite.xml /sp /lm/w3svc/66485902 /children /p <password>
If you leave out the /children option, only the configuration of the virtual root will be exported, and not the configuration of any virtual directories below the root.
Let's now import the configuration of the Default Web Site, which we exported above as default.xml, but first let's delete the Default Web Site:
> iisweb /delete "Default Web Site"
To recreate the Default Web Site, import its previously saved configuration:
> iiscnfg /import /f default.xml /sp /lm/w3svc/1 /dp /lm/w3svc/1 /children
Here /dp stands for the destination path, i.e., the metabase key, into which you want to import the configuration data. Again, /children ensures that subkeys are imported as well.
We can even import a second copy of the Default Web Site and assign it the site ID number 2 as follows:
> iiscnfg /import /f default.xml /sp /lm/w3svc/1 /dp /lm/w3svc/2 /children
Note that in IIS Manager, the copy of the site won't start unless you assign it a unique IP address.
Discussion
Metabase export files don't include encrypted properties (such as AdminACL) the way metabase backup files do. If you want to export a configuration that can be imported into a different IIS computer, be sure to password protect the export file and remove any computer-specific information it contains such as metabase properties referencing the IUSR or IWAM accounts used by IIS, the AdminACL, and any properties that use passwords before exporting it. Also, be sure to recreate the content folders on the target computer exactly as on the source computer.