Packaging and Restoring a Web site

  • Author: faith_a
  • Published on March 23, 2008 by faith_a
  • Updated on March 26, 2010 by faith_a
About the Author
faith_a
faith_a

Forum Posts: 117

This quick guide will show you how to create an package (compressed file) of a Web site, and then restore the site from the package.

Prerequisites

This guide requires the following prerequisites:

  • .NET Framework 2.0 SP1 or greater
  • Web Deployment Tool 1.1

Note: If you have not already installed the Web Deployment Tool, see Installing Web Deploy.

To package and restore an IIS 6.0 Web site

1. To create a package, run the following command:

msdeploy.exe -verb:sync -source:metakey=lm/w3svc/1 -dest:package=c:\dws.zip > DWSpackage6.log

2. To restore the package, run the following command:

msdeploy.exe -verb:sync -source:package=c:\dws.zip -dest:metakey=lm/w3svc/1 > DWSpackage6.log

To package and restore an IIS 7 Web site

1. To create a package, run the following command:

msdeploy.exe -verb:sync -source:apphostconfig="Default Web Site" -dest:package=c:\dws.zip > DWSpackage7.log 

2. To restore the package, run the following command:

msdeploy.exe -verb:sync -source:package=c:\dws.zip -dest:apphostconfig="Default Web Site" > DWSpackage7.log

 

Options for packaging multiple sites or objects

If you need to package a second directory outside the scope of your Web site, or you want to include other sites or objects, you have two options:

  • Package each of them separately
  • Create a manifest file to package multiple paths (see Using Custom Manifests)

Summary

You have now created a package of a Web site, and restored the site from the package. This is useful if you need to revert to a prior version of the site, or if files have become corrupt or missing from the site’s content directory.

Forum discussion

You can participate in a discussion about Web Deploy by clicking here.

Submit article feedback

You must Log In to submit feedback.