First, introduce my experimental environment.
SOURCE IIS7 Server
Os:windows Server 2008 Datacenter
Machine Name: Web1
Ip:192.168.1.20/24
The IIS role services installed are as follows
Download (49.65 KB)
2008-4-27 19:53
Download (54.08 KB)
2008-4-27 19:53
Target IIS7 Server
Os:windows Server 2008 Datacenter
Machine Name: WEB2
Ip:192.168.1.30/24
Install the same role Services as the source IIS7
There are three test sites in the author's environment, as shown in the following figure
Download (52.68 KB)
2008-4-27 19:53
The site directory is in E:\web, with a total of 3 websites. The log directory is placed in E:\IISlog, as shown in the following figure
Download (23.85 KB)
2008-4-27 19:53
Where the web directory assigns read-only access to IUSR and Iis_iusrs, the administrator and system have Full Control permissions, as shown in the following figure
Permissions for IUSR and IIS_IUSRS
Download (22.64 KB)
2008-4-27 19:53
Download (23.93 KB)
2008-4-27 19:53
Permissions for administrators and system
Download (27.41 KB)
2008-4-27 19:53
Download (29.02 KB)
2008-4-27 19:53
After introducing the experimental environment, the next introduction IIS7 users and Groups, IIS7 use IUSR built-in account to replace the previous IUSR_machinename account, the use of IIS_IUSRS to replace the previous IIS_WPG group, IUSR is a built-in account, he no longer need a password. Logically you can assume that he is the NetworkService or LocalService account number. The built-in accounts and groups are ensured by the operating system so that there is a single sid,iis even better, and he ensures that the new account name and group name will never be localized. For example, whether you install a language version of the WINDOWS,IIS account name will always be IUSR, and the group name will always be IIS_IUSRS.
The great benefit of moving our site to another IIS7 is that you can use xcopy/o to seamlessly copy documents along with their ownership and ACL information to different machines.
Reference understanding User and Group Accounts with IIS7
Url:http://www.iis.net/1026/singlepagearticle.ashx
Next describes the IIS7 Web site configuration file, IIS7 refers to the configuration file is the site Web.config and and C:\Windows\System32\inetsrv\config under the configuration file, are text-based XML files. of which C:\Windows\System32\inetsrv\config\ ApplicationHost.config inside the PhysicalPath defines the physical path of each site, and if the site directory of the target IIS7 server is inconsistent with the source IIS7 server site Directory, replicate applicationhost.config to the target IIS7 server , you will also change the PhysicalPath path to the actual path in the target server, web1 in the following C:\Windows\System32\inetsrv\config\ The contents of PhysicalPath are involved in applicationhost.config.
<sites>
<site name= "Default Web Site" id= "1" >
<application path= "/" >
<virtualdirectory path= "/" physicalpath= "%systemdrive%\inetpub\wwwroot"/>
</application>
<bindings>
<binding protocol= "http" bindinginformation= "*:80:"/>
</bindings>
</site>
<site name= "Hello" id= "2" >
<application path= "/" applicati>
<virtualdirectory path= "/" physicalpath= "E:\web\Hello"/>
</application>
<bindings>
<binding protocol= "http" bindinginformation= "*:80:www.hello.com"/>
</bindings>
</site>
<site name= "DIY" id= "3" >
<application path= "/" applicati>
<virtualdirectory path= "/" physicalpath= "E:\web\diy"/>
</application>
<bindings>
<binding protocol= "http" bindinginformation= "*:80:www.diy.com"/>
</bindings>
</site>
<site name= "beijing2008" id= "4" >
<application path= "/" applicati>
<virtualdirectory path= "/" physicalpath= "E:\web\beijing2008"/>
</application>
<bindings>
<binding protocol= "http" bindinginformation= "*:80:www.beijing2008.com"/>
</bindings>
</site>
After introducing the Post lab environment and related background knowledge, the migration operation begins
The target IIS7 server, or WEB2, executes the following command to copy the source IIS7 server, which is the Web1 site content, to the same path as the WEB2
xcopy \\192.168.1.20\e$\web/o/e/h/R e:\web
In WEB2 execute the following command to copy the Web1 log to the same path as WEB2
xcopy \\192.168.1.20\e$\iislog/o/e/h/R e:\IISlog
In Web2, execute the following command to copy all IIS configuration files web1 to the same path as WEB2
xcopy \\192.168.1.20\c$\windows\system32\inetsrv\config/o/e/h/R c:\windows\system32\inetsrv\config
After the replication is complete, check the WEB2 Site Directory permissions and find the same permissions as the Web1 site directory, as shown in the following figure
Download (24.43 KB)
2008-4-27 19:53
Download (23.93 KB)
2008-4-27 19:53
Then open the Web2 IIS Admin interface and find that the contents are exactly the same as the WEB1 content!
Download (42.84 KB)
2008-4-27 19:53
Test if the migrated Web site can be normal access, in this experimental environment, by modifying the WEB2 hosts to explain the domain name
Download (16.85 KB)
2008-4-27 19:53
In web2 open IE browser, test the above three URLs, the result is very successful!
Download (12.79 KB)
2008-4-27 19:53
download (15.58 KB)
2008-4- 19:53
download (32.65 KB)
2008-4-27 19:53
Summary: Migration between IIS7 servers is very simple, because IIS7 has all configurations in an XML file and no longer uses binary metabase to store the configuration. This will undoubtedly provide more tools and methods for migrating a Web server with hundreds of sites. In my lab environment, all sites can be completely migrated from one IIS7 server to another IIS7 Web site with an xcopy command.