Export Web Site With WebDeploy - Easy Peasy

WebDeploy Easy PeasyThe other night there was a serious requirement to export an IIS 7.0 Web Site to another IIS 7.0 Server. WebDeploy 2.0 is not new by any means but would do the job perfectly. WebDeploy impressed me after reading about it years ago but never had the opportunity or need to leverage it. There is no argument WebDeploy could, better still, would make my life much simpler regarding internal deployments and customer deployments at work too but in my current space was not an option. The winds of change are blowing!

I wanted to deploy two websites NancyFx Host Web Site, hosting internal Ideastrike, and Services Web Site hosting internal NuGet Server quickly from my development machine to another internal server for hosting for a small evaluation period. WebDeploy permitted me to do this in less than five minutes. Yes, no creating the sites manually, no xcopy or fighting with an MSI installation framework! Creating the export package was straight forward, using a dead simple wizard. Of course, the import is even simpler!

After this experience and reading a bit more about WebDeploy things are very clear, there is tremendous value to be had. Features like IIS migration and synchronization, web application package, and integration in continuous build process have great value and cannot be overlooked. An important next step, brainstorming how this product can help clients maintain clean exact copies of environments for testing purposes. Teams can waste large amounts of time debugging installation and configuration issues which in most cases could be averted, especially with WebDeploy migration and synchronization features.

Here is a quick overview of WebDeploy 2.0 feature-set and the steps used to create an export package for a website(s), application pool(s), and even SQL Server database.

WebDeploy 2.0 Features

  1. Seamless integration with IIS 7.0 Manager and Visual Studio 2010 interface for creating packages and deploying them onto a machine, both locally and remotely.
  2. Seamless integration with the Web Platform Installer to install community web applications simply and easily.
  3. Web application packaging:

    • Ability to package a Web application or an entire site, including the associated databases.
    • Ability to package ACLs, COM, GAC and registry settings.
    • Supports both live servers and zipped packages as a source or destination.
  4. Web application deployment:

    • Administrative privileges are not required in order to deploy Web applications.
    • Ability to add powerful parameters to change text in files when they are deployed (such as prompting to replace a connection string when deploying from QA to staging environments).
    • Integration with the IIS 7.0 Web Management Service (WMSVC) for remote deployment by non-administrators.
    • Server administrators have granular control over the operations that can be performed and can delegate tasks to non-administrators.
  5. Web server migration and synchronization:

    • Ability to synchronize or migrate the entire Web server, a Web site or application.
    • Synchronizes only the data that has changed.
    • Ability to detect missing dependencies during synchronization.
    • Automatically gathers content, IIS configuration, SSL certificates and ASP.NET configuration when you sync a Web site.
  6. In addition to the IIS Manager and Visual Studio 10, tasks can be performed using the command-line or public AP

Create Export Server Package for WebSite


  • .NET Framework 2.0 SP1 or greater
  • WebDeploy 2.0
  • IIS 7.0 or IIS Remote Manager

Export Steps:

  1. Open IIS 7.0 Manager
  2. Select the first node, server name
  3. Far right in Deploy section, click on Export Server Package
  4. In Export Server Package Dialog click Manage Components
  5. In Manage Components remove the first provider name, webServer by clicking the Remove button on far right. The goal is to export the web site not the entire server configuration. In the Manage Components alert confirmation message, click Yes.
  6. If there is a custom application pool that must be migrated with the web site or any of the web applications in the site it MUST be included or the package import will fail. To include application pool(s) proceed to step 7 else skip to step 9.
  7. Click the Provider Name column in the first row. Select appPoolConfig from the Provider Name drop down box.
  8. Enter the exact name of the application pool in the second column, Path.
  9. To export a Web Site, click the Provider Name column in the second row. Select appHostConfig from the Provider Name drop down box.
  10. Enter the exact name of the web site in the second column, Path.
  11. To add SQL Server database to the export package, follow detailed steps outlined in Export a package through IIS Manager. The SQL Server details starts on step six.
  12. Click OK
  13. Click Next twice
  14. Browse to where package will be exported then saved
  15. Click Next
  16. Click Finish

Import Steps:

  1. Open IIS 7.0 Manager
  2. Select the first node, server name
  3. Far right in Deploy section, click Import Server or Site Package.
  4. Browse to import package *.zip file
  5. Click Next three times
  6. If the Web Site already exists answer the Overwrite Existing Files question.
  7. Click Next
  8. Click Finish