To achieve load balancing or server migration, we may use multiple Web servers, which means we need to configure the same sites and application pools for multiple IIS. Do we need to rebuild them one by one according to the needs? Of course not! That would take a lot of time! We only need to execute some simple commands to export and import these configurations on IIS~
When we create a site on IIS7 or IIS7.5, IIS will automatically create a unique application pool for the site. Therefore, if we want to import website information, we must first import application pool information; the following will introduce how to use the Windows built-in appcmd command to import and export the configuration of IIS sites and application pools to achieve IIS site migration. Note: The appcmd command is in the C:\Windows\System32\inetsrv directory. When using the appcmd command, you need to enter this directory or add the directory to the Windows system environment variables. Target server IIS environment creation First, we need to install the IIS environment on the target server, and make it consistent with the IIS environment of the original server; the following takes this environment as an example to migrate the www and App sites. IIS Application Pool and Site Export 1. Export IIS application pool configuration (specify application pool or all application pools) Execute the following command in the Windows DOS window to export the IIS application pool:
Among them, c:\allpools.xml is the exported IIS program pool configuration file, and the path can be changed as needed; after exporting, you can see the configuration file in the specified directory. This command will export all IIS application pools on the server, but some of them are not needed and need to be deleted. For example: DefaultAppPool You can use a file editor to open the exported IIS application pool configuration file allpools.xml and delete it. Find the corresponding DefaultAppPool program pool configuration and delete it, starting with Ending content. Export a single IIS application pool %windir%\system32\inetsrv\appcmd list apppool "www" /config /xml > c:\wwwpool.xml 2. Export IIS site configuration (specify site or sites) Export all IIS sites
Similarly, after exporting all sites, there may be sites that we don’t need. We delete their configuration in the exported sites.xml: Default Web Site Find the corresponding Default Web Site configuration and delete it. Exporting a Single IIS Site
IIS Application Pool and Site Import The target server currently only has the default site of Default Web Site 1. Import IIS application pool configuration First, copy the IIS application pool and site configuration files exported in the previous step to the target server. Execute the following command to import the IIS application pool:
Here the c:\allpools.xml path is changed to the path copied to the target server If DefaultAppPool is not deleted in the configuration file exported above and the program pool exists on the target server, an error will occur during import. Simply delete the corresponding duplicate application pool configuration files, or delete the duplicate application pool on the target server before importing it. The same is true for importing site configurations. At this point, the application pools for the www and App sites have been successfully imported into the IIS of the target server. Importing a single IIS application pool configuration
2. Import IIS site configuration Importing IIS site configuration
In the era of cloud computing, an excellent operation and maintenance personnel not only needs to be brave enough to stand at the forefront of operation and maintenance accidents and have the ability to turn danger into safety; it also requires us to do a good job of real-time monitoring of the business and the ability to prevent problems before they occur. |
<<: Where is the entrance to 5G message service? You may not think of it
>>: How to solve the packet loss problem in TCP transmission protocol
Network connection and communication are the know...
Watching short video apps like Tik Tok and Kuaish...
The last time I shared information about CheapWin...
Last time, I shared the End of Life Plans series ...
Last month, the tribe shared information about RA...
5G is the present and the future, the next genera...
Wen Ku, spokesman for the Ministry of Industry an...
Development Background Synaesthesia integration: ...
Everyone has a wireless router at home. However, ...
Hello everyone, I am Dayao. I have written an art...
Market development and technological progress com...
HostKvm is a foreign hosting service provider fou...
In the third and fourth quarters of 2021, China T...
JuHost was registered in Hong Kong in early 2023,...
Recently, F5 Networks (NASDAQ: FFIV) launched NGI...