Move your IIS App pools from one machine to another

So,

Today I got a new machine and didn’t want to have to set my IIS up again.

So I ran the following from a command prompt run as administrator:

%windir%\system32\inetsrv\appcmd list apppool /config /xml > c:\apppools.xml


This created an xml file with all my app pools in it. I deleted  6 nodes that held the default iis app pools:

  • DefaultAppPool
  • Classic .NET AppPool
  • .NET v2.0 Classic
  • .NET v2.0
  • .NET v4.5 Classic
  • .NET v4.5
Then I went to my new machine after copying over the edited apppools.xml file and ran this command:

%windir%\system32\inetsrv\appcmd add apppool /in < c:\apppools.xml

And all my app pools were added:

To export all my sites I ran this:

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

It exported all my sites to an xml file. I edited this and removed the default web site as it was already present on the destination machine.

Then I ran this on the destination machine:

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

And it imported all my sites into IIS:

That is all,

Russ

Advertisements

How to install TCP / Named Pipes and some IIS bindings on a server

Morning,

Thought I would share this as it is very useful for installing server features and setting up IIS for your binding needs.


Here is the PowerShell script:



Here are the server features before the script runs:



IIS Before:



The script running:




The server after:



IIS After:



Named Pipes and TCP Listeners installed and running:

 

Thanks for listening,

Russ