IIS 7 To export/import a single website

Step1 Export:
%windir%\system32\inetsrv\appcmd list site “MyWebsite” /config /xml > c:\mywebsite.xml

Step2 Hack xml:
Hack name & id attributes in second site element , c:\mywebsite.xml

e.g.
<site name="mywebsite" id="1" serverAutoStart="true">
to
<site name="mywebsite2" id="2" serverAutoStart="true">

Step3 Import:
%windir%\system32\inetsrv\appcmd add site /in < c:\mywebsite.xml

Reference: :http://www.microsoftpro.nl/2011/01/27/exporting-and-importing-sites-and-app-pools-from-iis-7-and-7-5/


Note for purpose of create new website and keep original website

  1. Manually add new application pool & set new applicationPool to your website.
  2. Set attribute of serverAutoStart to “false”
  3. Set new attribute to bindingInformation.

沒有留言:

張貼留言