IIS Home @ it-notebook.org

Web Deploy, Error: Could not find the drive

(Kristofer Gafvert, July 17, 2010)

The scenario

Imagine that you are migrating from IIS 6 to IIS 7, and are using the Web Deployment tool. Also imagine that you are moving your web site(s) from E:\ (old server) to D:\ (new server). You create the package on the old server, and try to restore the package on the new server. But when doing that, you are faced with the following error message:

Error: Could not find the drive 'E:\'. The drive might not be ready or might not be mapped.

The solution

By default, the Web Deployment tool try to restore to the same location. So when importing on the new server, you need to use the replace rule to specify the new location. This would look something like:

-replace:objectName="metaProperty",scopeAttributeName="name",scopeAttributeValue="Path", targetAttributeName="value",match="E:",replace="D:"

An example of a complete command to restore the web site looks like (you need to modify this to apply to your situation):

msdeploy.exe -verb:sync -source:package=c:\dws.zip -dest:metakey=lm/w3svc/1 -replace:objectName="metaProperty",scopeAttributeName="name",scopeAttributeValue="Path", targetAttributeName="value",match="E:",replace="D:" -whatif > DWSpackage6.log

Both examples above may have been wrapped. They should of course be on one line.

Applies to [?]

IIS 6.0, IIS 7.0, IIS 7.5

Resources

Web Deployment Tool