Freigeben über


Migrating a Web Server from IIS 6.0 to IIS 7

Applies To: Windows 7, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008 R2, Windows Vista, Windows XP

You can use the Web Deployment Tool (Web Deploy) to migrate your Web server or Web site from a computer that is running Information Services (IIS) version 6.0 on Microsoft® Windows Server™ 2003 to a computer that is running IIS 7.0 on Windows Server 2008 or IIS 7.5 on Windows Server 2008 R2. (In this documentation, "IIS 7" refers to both IIS 7.0 and IIS 7.5.) You can also use Web Deploy to migrate from an IIS 6.0 Web server to another IIS 6.0 Web server, or from an IIS 7 Web server to another IIS 7 Web server.

Warning

Migration from IIS 7 to IIS 6.0 or earlier versions of IIS is not supported.

This article describes how to install the Web Deployment Tool, migrate a Web server from IIS 6.0 to IIS 7, and how to perform post-migration configuration steps. It also discusses the migration of application pools from Classic to Integrated mode.

The configuration storage architecture in IIS 7 has changed significantly from those in earlier versions of IIS. IIS 7 replaces the legacy metabase with a new text-based file that is named ApplicationHost.config that stores global configuration settings in XML format. As a result of this change, you cannot use utilities such as Iiscnfg.vbs to migrate the configuration of an IIS 6.0 Web server to IIS 7.

This article describes the specific scenario in which you migrate a Web Server that is running IIS 6.0 on Windows Server 2003 to a Web server that is running IIS 7 on Windows Server 2008 on a different physical or virtual computer.

Installing Web Deploy

Before you install Web Deploy, make sure that you have .NET Framework version 2.0 SP1 or 3.5 (which includes 2.0 SP1) installed on your computer. For download links, see Requirements and Limitations. After the .NET Framework has been installed, see Web Deployment Tool Installation for the download links for the tool itself.

You must install the bitness-appropriate version of Web Deploy on both the source IIS 6.0 Web server and the destination IIS 7 Web server. Perform the following steps to perform a "custom" installation on the source IIS 6.0 Web Server, and a "typical" installation on the destination IIS 7 Web server.

To perform a "custom" install of the Web Deploy Tool on the source IIS 6.0 Web server

  1. Click the Web Deployment Tool (x86) or Web Deployment Tool (x64) download link in the Web Deployment Tool Installation topic.

  2. On the Security Warning dialog box, click Run.

  3. On the Welcome to the Microsoft Web Deployment Tool Setup Wizard page, click Next.

  4. On the End-User License Agreement page, select the I accept the terms in the license agreement, and then click Next.

  5. On the Choose Setup Type page, click Custom.

  6. On the Custom Setup page, click the Remote Agent Service down arrow, select Will be installed on local hard drive, and then click Next.

  7. Click Install.

  8. Click Finish.

  9. In Computer Management, under Services, verify that the Web Deployment Agent Service is started.

To perform a "typical" install of the Web Deployment Tool on the destination IIS 7 Web server

  1. Perform steps 1 through 4 in the previous procedure.

  2. On the Choose Setup Type page, and then click Typical.

  3. Click Install.

  4. Click Finish.

Important

In this scenario, the Web Deployment Agent Service is not installed or required on the destination IIS 7 Web server.

Using Web Deploy to Migrate from IIS 6.0 to IIS 7

This section describes the recommended steps you must follow in order to use Web Deploy to migrate from IIS 6.0 to IIS 7.

  1. Create a backup of the configuration of the destination IIS 7 Web server.

  2. Verify dependencies on the source IIS 6.0 Web server.

  3. Install any necessary software components on the IIS 7 Web Server.

  4. Verify the migration outcome by using the -whatif flag before you perform the migration.

  5. Run the Web Deploy sync operation to perform the migration.

Warning

The Technical Preview (Beta) version of the Web Deployment Tool used a migrate verb to synchronize IIS 6.0 to IIS 7. For greater simplicity and ease of use, the migrate verb has been replaced by the sync verb in Web Deploy 1.0 and 1.1.

Creating a Backup of the IIS 7 Destination Web Server Configuration

You should always create a backup of your destination IIS 7 Web server configuration before you use Web Deploy to migrate an IIS 6.0 Web site or server to IIS 7. You can create the backup by using the AppCmd.exe command line tool which is included with IIS 7. The AppCmd.exe tool is located in the %windir%\system32\inetsrv folder.

Warning

By default, the inetsrv folder is not included in the Path environment variable.

The following examples illustrate how to create, list, and restore a backup of your IIS 7 configuration files. It is assumed that you have either navigated to the %windir%\system32\inetsrv folder by using the command prompt, or have added a reference to the folder to the Path environment variable before you execute the commands in the following example.

To create a backup by using AppCmd.exe

  1. At the command prompt, type

    appcmd add backup "PreMigration"

  2. Press ENTER.

To list all existing backups by using AppCmd.exe

  1. At the command prompt, type

    appcmd list backup

  2. Press ENTER.

To restore a backup by using AppCmd.exe

  1. At the command prompt, type

    appcmd restore backup "PreMigration"

  2. Press ENTER.

Using Web Deploy

Web Deploy is installed in the C:\Program Files\Microsoft Web Deploy folder, and the executable file is named Msdeploy.exe. Setup does not add this folder to the system Path environment variable. It is assumed that you have used the command prompt to navigate to this folder or that you have added a reference to this folder to the Path environment variable before executing the commands in the following examples.

To list Web Deploy syntax and usage examples by using Web Deploy

  1. At the command prompt, type

    msdeploy /?

  2. Press ENTER.

Verifying Dependencies on the Source IIS 6.0 Web Server

After making a configuration backup of your destination IIS 7 Web server, you should verify dependencies on the source IIS 6.0 Web server. The results of the verification process can help you verify the settings required to correctly perform the migration.

Web Deploy dependency verification automatically performs the checks on data in the Web root folder on the source Web Server. If you have a large amount of data or many files, it may take you a long time to complete this process.

To verify IIS 6.0 dependencies by using Web Deploy

  1. At the command prompt, type

    msdeploy -verb:getDependencies -source:metakey=lm/w3svc

  2. Press ENTER.

The following is an example of a dependency report from an IIS 6.0 Web server:

<dependencyInfo>

    <dependencies>

        <dependency name="AnonymousAuthentication" />

        <dependency name="WindowsAuthentication" />

        <dependency name="BasicAuthentication" />

        <dependency name="ISAPIFilter" />

        <dependency name="FrontPageServerExtensions" />

        <dependency name="DigestAuthentication" />

        <dependency name="ASP" />

        <dependency name="ServerSideIncludeDisabled" />

    </dependencies>

    <apppoolsInUse>

        <apppoolInUse name="DefaultAppPool" definitionIncluded="True" />

        <apppoolInUse name="MSSharePointAppPool" definitionIncluded="True" />

        <apppoolInUse name="WebDavAppPool" definitionIncluded="True" />

    </apppoolsInUse>

    <isapis>

        <isapi dll="C:\WINNT\system32\inetsrv\httpodbc.dll" enabled="False" />

    </isapis>

</dependencyInfo>

The results returned by the getDependencies command should not be considered a definitive list because Web Deploy may not find every component dependency. getDependencies may identify some components (such as WebDAV and FrontPage Server Extensions) that are not supported by IIS 7. It is also possible that getDependencies will report some components that are installed as dependencies, but that are not actually being used, so you should verify which components are actually being used, and install only the Role Services that you need on the destination IIS 7 Web Server.

For more information about how to use getDependencies, see Viewing Dependencies, Web Deploy GetDependencies Operation, and How Dependencies are Determined.

Installing Required Software Components on the Destination IIS 7 Web Server

Based on the results of the preceding dependency audit, use the output to help with preparing the destination IIS 7 Web server for the migration. After you verify whether the following listed component dependencies are actually being used on the source IIS 6.0 Web server, perform any of the following steps if they are required.

  • Install the Web Server (IIS) role.

  • Install the following role services:

    • Windows authentication

    • HTTP redirection

    • ISAPI filters (only supported in IIS 7 classic pipeline mode)

    • ASP

    • ASP.NET

    • Static Content Compression (installed by default when you add the Web Server role)

    • ASP.NET

Important

Do not install Server Side Includes.

Note

You do not have to install the IIS 6.0 Management Compatibility feature on the destination IIS 7 Web server for Web Deploy to perform the migration. Metabase compatibility is managed internally by Web Deploy itself.

Pre-testing the Migration Behavior

After you install all necessary roles and role services on the IIS 7 destination Web server, you can migrate from the IIS 6.0 Web server to the IIS 7 Web server. But before you perform the actual migration, you should pre-test the likely migration behavior by using the sync command with the -whatif switch and store the results in a log file.

The following procedure shows how to pre-test the migration behavior before performing the migration.

To pre-test migration behavior by using Web Deploy

  1. At the command prompt on the destination IIS 7 Web server, type

    msdeploy -verb:sync -source:webserver60,computerName=Server1 -dest:webserver60 -whatif > msdeploy_test.log

    Replace "Server1" with the name of your source IIS 6.0 server.

  2. Press ENTER.

Running the Web Deploy Sync Command

After verifying the changes in the output log files, you can perform the actual migration by using the same command, but omitting the -whatif switch.

To migrate an IIS 6.0 server to an IIS 7 server by using Web Deploy

  1. At the command prompt on the destination IIS 7 Web server, type

    msdeploy -verb:sync -source:webserver60,computerName=Server1 -dest:webserver60 > msdeploy_test.log

    Again, you should replace "Server1" with the name of your source IIS 6.0 server.

  2. Press ENTER.

Note

If your site contains a very large amount of Web content, or many NTFS file system ACLs, or both, you can instruct Web Deploy to skip content migration. To omit enumeration and content migration, add the -disableLink:ContentExtension argument to the Web Deploy sync command in the previous examples. For more information about link extensions, see Web Deploy Link Extensions.

Including Custom Objects in a Migration

After you execute the sync command, the migration is complete. All IIS configuration, .NET configuration (Machine.config and root Web.config files), certificates, and Web content and associated NTFS ACLs are migrated to the server that is running IIS 7 on Windows Server 2008. However, if you have a custom .NET assembly in the Global Assembly Cache (GAC) or other additional objects, they can be moved by using a manifest file.

Here is a list of some additional objects that you may want to include in a migration:

  • Custom .NET assemblies in the Global Assembly Cache (GAC)

  • A custom directory path that is not included in your Web site paths

  • Registry keys

  • Custom COM components

For more information about how to use a manifest file, see Creating and Synchronizing a Custom Manifest and Web Deploy manifest Provider.

Performing Post-Migration Configuration Steps

After the migration, you will find the IIS configuration in the IIS 7 ApplicationHost.config file, which is located in the %windows%/system32/inetsrv/config folder.

However, you may still have to configure other Web server-related components, including the following:

  • Platform components, such as specific versions of the .NET Framework, ASP.NET Ajax, and the AJAX Control Toolkit

  • Custom Windows services

  • Custom scheduled tasks

To complete the configuration of your migrated Web server, you can install these components either manually or by using a Web server build script. However, additional components that you may want to configure or migrate may be addressed by other providers. For example, environment variables are stored in a registry key and therefore could be included in a custom manifest file. You should ensure that the components support this kind of migration. If you try to move a component by only moving the registry key or file location where the component is stored, verify that the component can be safely moved in this manner.

After you have completed any post-migration steps, you can verify the behavior of your site by browsing to it and examining how it responds.

Migrating Application Pools from Classic to Integrated Mode

For backward compatibility with IIS 6.0, Web Deploy configures all IIS 7 application pools in Classic request-processing mode (instead of IIS 7 Integrated mode) as part of the migration process. Web Deploy uses Classic mode because some ASP.NET applications developed for use by IIS 6.0 may require modification before they can run correctly in Integrated mode.

Migrating application pools to Classic mode helps ensure that your sites will function as expected after migration. Web Deploy is designed to help you migrate from IIS 6.0 on Windows Server 2003 to IIS 7 on Windows Server 2008, and it is beyond the scope of Web Deploy to eliminate all compatibility issues between Classic and Integrated modes in IIS 7.

For more information about how to migrate existing ASP.NET applications to IIS 7 Integrated mode, see ASP.NET Integration with IIS7.

Summary

This article described how to install Web Deploy and how to use Web Deploy to migrate a Web Server that is running IIS 6.0 on Windows Server 2003 to a Web Server that is running IIS 7 on Windows Server 2008. It then described how to perform post-migration configuration steps, and discussed migrating application pools from Classic to Integrated mode.

See Also

Concepts

Web Deploy Providers
Web Deploy comObject32 Provider
Web Deploy comObject64 Provider
Web Deploy gacAssembly Provider
Web Deploy regKey Provider

Other Resources

Web Deploy (IIS.NET)
Microsoft Web Deployment Team Blog (IIS.NET)