Creating and Synchronizing a Custom Manifest
Applies To: Windows 7, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Vista, Windows XP
Web Deploy custom manifests are a powerful way to create your own custom deployment operations. You can use them to create your own definition of a Web site or server, include additional directories that lie outside the scope of your site in IIS, or perform an operation by using a predetermined set of providers that are appropriate for your environment.
This topic shows you how to create a custom manifest file and synchronize it by using the Web Deploy manifest provider.
The Manifest Provider and Manifest Files
Web Deploy uses the manifest provider to process manifest files. The manifest provider takes an argument that is a path to a manifest file (for example, c:\manifest.xml).
A custom manifest file is in XML format and contains a list of providers with path attributes. The providers are executed in the order that they are listed in the manifest. For example, a custom manifest might have an appHostConfig, a contentPath, a comObject32, a regKey, and a gacAssembly provider. The manifest provider processes each of these in order.
Creating and Synchronizing a Manifest File
A manifest file groups providers into one definition. See the following example.
<sitemanifest> <appHostConfig path="mySite" /> <appPoolConfig path="mySitePool" /> <gacAssembly path="'System.Web, Version=126.96.36.199, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'" /> <comObject32 path="Microsoft.ApplicationHost.AdminManager" /> <contentPath path="c:\MyExtraFiles" /> <regKey path="HKLM\Software\ODBC" /> </sitemanifest>
To create a custom manifest file
Copy the sample manifest file listed in the previous section into Notepad.
Name the file Custom.xml and save it into your Web Deploy installation directory. By default, this is %programfiles%\IIS\Microsoft Web Deploy. This step is not required, but will make the command easier for you to execute.
Create a directory named MyExtraFiles on drive C.
Run the following command to synchronize the objects listed in the manifest file to an archive.
msdeploy -verb:sync -source:manifest=custom.xml -dest:archivedir=c:\archive >msdeployarchive.log
By specifying >msdeployarchive.log, the results of the archive operation will be saved in a log file for easy reference. If you open the archive that was created, you will see the files for the Web site itself and the additional "MyExtraFiles" directory that is outside the scope of the Web site.
The archive that you have created can now be used as a backup for the site. The example used a manifest file as the source and an archive directory as a destination. However, you can also use an archive as a source and synchronize it to a manifest file that is a destination. In that case, data is taken from the archive and synchronized with whatever providers are specified in the manifest file.
If you mistype a file path in a manifest, and the file path does not exist, no error will be returned. If a manifest that you have created does not behave as you expect, make sure that each element of the manifest is correct.
Using Two Manifests
You can perform a sync operation by using two manifests. To do this, you must set both the source and the destination to specify the manifest provider. For example, you could run the following command to synchronize an IIS 6.0 site to another server by using manifest files.
msdeploy.exe -verb:sync -source:manifest=custom.xml -dest:manifest=custom.xml,computerName=Server1 >msdeploysync.log
The computerName provider setting that is attached to the
–dest:manifest=custom.xml argument is important for defining the location of the destination.
You have now created a custom manifest and used it to synchronize the objects that it specified to an archive directory. You can extend the manifest even more by adding provider paths that are important for your Web site or Web server, such as a registry key or an assembly in the Global Assembly Cache.