2

I am trying to replicate a deployment that was done by hand on one windows server for IIS to another. For comparison from time to time I use Export-IISConfiguration cmdlet to assert if my configuration script is going in the right direction. After splitting my hairs (since for what ever reason static file handler gets executed, but not the handler configured in the application) I've decided to try importing the configuration that was produced by the old server via former command, but to my surprise, there is no Import-* counterpart for that command.

How do you import IISConfiguration?

Both nodes are on IIS10 running .net framework 4.8

Dragas
  • 1,140
  • 13
  • 29
  • Anytime you want to move a site from one server to another, you should use Web Deployment Tool, https://learn.microsoft.com/en-us/iis/publish/using-web-deploy/synchronize-iis That's why there isn't a simple PowerShell cmdlet. – Lex Li Nov 18 '21 at 05:28
  • The two machines are not in the same network nor can they install anything that's not available via dism or `add-windowsfeature` cmdlet. – Dragas Nov 18 '21 at 08:46
  • Without using a convenient tool like that, a lot of manual steps are required and like I said no cmdlet is there to help. – Lex Li Nov 18 '21 at 14:56
  • That's fine. As long as I can call the appcmd directly and use that it's fine. That's why I am writing a script to begin with. – Dragas Nov 18 '21 at 15:27
  • Powershell has list all cmdlet to import specific configuration of IIS. I'm not sure whick kind of configuration you want to migrate. But appcmd can backup the old IIS, then you can use appcmd import backup to new IIS. – Bruce Zhang Nov 19 '21 at 03:18
  • I see a similar question like this which already has the answer. https://stackoverflow.com/questions/493236/how-do-you-migrate-an-iis-7-site-to-another-server – Đạt Lê May 10 '22 at 04:22
  • @LexLi - Does web deploy have any impact on the source website? – variable Jun 21 '22 at 11:42

0 Answers0