Iis – Export & Import – Single IIS WebSites using powershell
iispowershell
Is there any way to export and import the single iis website from one server to another.
Thanks,
Sandesh
Best Answer
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
When you are viewing your SSL Certificates in the IIS Management Console, right-click the certificate and choose Export...
You can then export a .pfx file. You will need to specify a password for it.
On your new server, simply go to the Server Certificates page and choose Import..., select the .pfx file from the previous server, enter your password, and that's it!
If they're just certificate authorities you're looking to import into a Trusted Roots or Intermediate Roots container, just change the extension to .cer or .crt and Windows should be able to handle it with little issues.
But if the .pem files are part of .pem/.key file pairs, then you'll have to convert them into a .pfx file before Windows can touch them. OpenSSL can be used to create such an archive.
Best Answer
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:
To Import the website:
Hope that helps a bit!