Is there any way to export and import the single iis website from one server to another.

Thanks, Sandesh


Yes you can, everything is in the IISAdministration Powershell module, using the Export-IISConfiguration cmdlet. You can visit this MS docs link to review what cmdlets best suit your specific needs.

You can also use a couple of commands: To Export website:

%windir%\system32\inetsrv\appcmd list site /config /xml > c:\sites.xml

To Import the website:

%windir%\system32\inetsrv\appcmd add site /in < c:\sites.xml

Hope that helps a bit!

| improve this answer | |
  • 1
    This still works for IIS 8 and IIS 10, just tested it Also good to know that this will import and export ALL items, including the "default website". So you will get an error if you try to import it and its already there. Make sure to delete them first (if you can afford to do that). Also this will not export the App Pools, only the value of the App Pool associated with the Web Site. You will need another process to Import/Export that. %windir%\system32\inetsrv\appcmd list apppool /config /xml > c:\apppools.xml and %windir%\system32\inetsrv\appcmd add apppool /in < c:\apppools.xml – Keith Nov 27 '19 at 21:20
  • Be careful with the appcmd list apppool /config command though - it exports the application pool passwords in clear text! – Marcus Mar 2 at 0:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.