How to restore xml in IIS configuration

  
                  

IIS6.0 has a function to export configuration, but you can't find the direct import configuration function on the interface. You need to use the iiscnfg.vbs script that comes with the operating system. (Picture small click to enlarge)

First, save/export/backup WEB configuration



Select a save path



Second, restore configuration

First open the backup weback20090901.xml file, view the path to the "default site" in the XML notation, later The command line needs to use



If the default website has lost the three virtual directories at the beginning of EX, the physical path of iisadmpsw has also been modified



Close the IIS Manager and enter the iiscnfg command (if prompted to register cscript.exe as the default script parser, answer “ is ”), the site configuration is restored, then Manually launch the default website, get it!



Command: iiscnfg /import /fc:iisbackweback20090901.xml /sp /LM/W3SVC/1 /dp /LM/W3SVC/1 /children

Explanation:

/import /f Import the configuration file, followed by the saved .xml configuration file

/sp Specify the .xml Source path, required

/dp Specifies the target path to be imported to the website, mandatory, /LM/W3SVC/1 refers to the first WEB site currently seen in IIS Manager

/children Import the configured sub-virtual directory configuration in .xml and import it

3. Merging mode

Sometimes only the configuration items in the saved .xml file are allowed to be replaced. Existing configuration, but some new virtual directories (that is, configurations not available in .xml) are not allowed to be replaced. You can use the merge mode, that is, the virtual directory added after the backup is retained, and the same virtual directory settings are replaced. This mode is recommended. Just add a /merge parameter after the above command.

Example: New aaa virtual directory to be retained, to restore the file at the beginning of EX, and restore the local path settings of iisadmpsw



Command, OK



iiscnfg /import /fc:iisbackweback20090901.xml /sp /LM/W3SVC/1 /dp /LM/W3SVC/1 /children /merge

Copyright © Windows knowledge All Rights Reserved