Migrating Application Pools and Sites in IIS from one Server to another Server.

Sometimes we need to migrate IIS data from one server to another server (applicatin pools,sites and applications) or else we need to restore the IIS data in the same machine after OS reinstallation. In such cases, we can export / import the application pools, site and applicaitons data using IIS appcmd command without recreating all of them again in the new server. This will also be usefull when your upgrading from IIS 7 to IIS 7.5

Exporting Application pools:

Use the below command for exporting the application pools
c:\Windows\system32\inetsrv> appcmd list apppool /config /xml > D:\apppools.xml

It will export all the application pools. We need to remove the default application pools (DefaultAppPool, Classic .NET AppPool etc) from the xml files, because those will be created automatically when IIS installed.

We can export particular app pool using the below statement
c:\Windows\system32\inetsrv> appcmd list apppool “MyAppPool” /config /xml > D:\myapppool.xml


Importing Application pools:

We can import application pools using below statement
c:\Windows\system32\inetsrv> appcmd add apppool /in < D:\apppools.xml
We can import particular app pool using the below statement
c:\Windows\system32\inetsrv> appcmd add apppool “MyAppPool” /in < D:\myapppool.xml

Exporting Websites:

Following statement exports all the websites
c:\Windows\system32\inetsrv> appcmd list site /config /xml > D:\sites.xml

This will export all the websites on your webserver. So you need to remove Default Website before importing.

Importing Websites:

We can import websites using below statement
c:\Windows\system32\inetsrv> appcmd add site /in < D:\site.xml


Exporting Applications:

Following statement exports all the applications under websites
c:\Windows\system32\inetsrv> appcmd list app /config /xml > D:\apps.xml

This will export all the applications in the websites including the default one's. So you need to remove apps with path="/"

Importing Applications:

We can import applications using below statement
c:\Windows\system32\inetsrv> appcmd add app /in < D:\apps.xml


Source

Gopikrishna

    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment