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
We can export particular app pool using the below statement
Source
Exporting Application pools:
Use the below command for exporting the application poolsc:\Windows\system32\inetsrv> appcmd list apppool /config /xml > D:\apppools.xmlIt 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 statementc:\Windows\system32\inetsrv> appcmd add apppool /in < D:\apppools.xmlWe 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 websitesc:\Windows\system32\inetsrv> appcmd list site /config /xml > D:\sites.xmlThis 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 statementc:\Windows\system32\inetsrv> appcmd add site /in < D:\site.xml
Exporting Applications:
Following statement exports all the applications under websitesc:\Windows\system32\inetsrv> appcmd list app /config /xml > D:\apps.xmlThis 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 statementc:\Windows\system32\inetsrv> appcmd add app /in < D:\apps.xml
Source
0 comments:
Post a Comment