This article will guide you through the process of creating a custom manifest and syncing it. We will sync a web site and also include the application pool, an external directory, assembly and COM object that are not automatically gathered for a web site.
Article Goal: Make a custom manifest so that I can create my own definition of a web site or server. I want a manifest because when I sync my web site, I always want to include some additional directories outside the scope of my site in IIS.
Prerequisites
This article requires the following prerequisites:
• .NET Framework 2.0 SP1 or greater
• MS Deploy Beta 1
Note: If you have not already installed MS Deploy, see Installing MS Deploy.
Overview of a Manifest
A manifest is simply a grouping of providers into one definition. It is a way of specifying multiple paths, such as a web site, application pool and assembly. It can be used to specify multiple web sites, multiple directories or other paths.
Note: In this article, we show moving an IIS 7.0 based web site and application pool, but you could also use the manifest on IIS 6.0 to specify an IIS 6.0 based web site and application pool.
Sample manifest
<myCustomSite>
<appHostConfig path="TestWebSite" />
<appPoolConfig path="TestAppPool" />
<dirPath path="C:\MyExtraFiles" />
<gacAssembly path="'System.Web, Version=2.0.0.0, Culture=neut
ral, PublicKeyToken=b03f5f7f11d50a3a'" />
<comObject path="Microsoft.ApplicationHost.AdminManager" />
</myCustomSite>
To create and use a custom manifest
1. Open Notepad and create an XML file. Let’s call it custom.xml.
2. Copy the sample manifest into custom.xml.
3. Copy custom.xml into your installation directory, %programfiles%\Microsoft Web Deploy.
Note: This is not necessary but makes it slightly easier to reference the XML file in the command.
4. Create a directory called MyExtraFiles in your C: drive or replace the directory with one that exists on your machine.
5. Run the following command to sync the objects in the manifest to an archive:
msdeploy.exe -verb:sync -source:manifest=custom.xml -dest:archivedir=c:\archive > webdeployarchive.log
By specifying > webdeployarchive.log, the results of the archive will be listed in the log file and we can easily refer back to it. This archive can now be used as a backup for the site, to sync to an IIS 6.0 server or to migrate to an IIS 7.0 server.
Open the archive, you should now see the site itself and the extra directory specified. You can sync from the archive to the manifest (meaning you’ll sync from the archive to whatever providers are specified in your manifest).
You can also perform a live sync or migrate operation with a manifest without using an archive. In order to sync two live providers using a manifest, you need to sync with the source and destination both set to manifest.
To sync a site using a custom manifest
1. Run the following command to sync an IIS 6.0 site to another server:
msdeploy.exe -verb:sync -source:manifest=custom.xml -dest:manifest=custom.xml,targetName=http://computername/MSDEPLOY/ > webdeploysync.log
Summary
You have now created a custom manifest and used it for operations. You can further extend the manifest by adding any provider paths that are important for your web site or server, such as a registry key or an assembly in the GAC.
Comments