3
votes

I am trying to msdeploy to restore the site on destination computer from the package i created on source IIS 7 site. The destination server IIS is also IIS7. The destination server however does not have the drive D: as the physical drive. the D: is associated to a CD Row drive. I use the replace attribute while using msdeploy but the rule does not work. Below is my command msdeploy -verb:sync -source:package=d:\site.zip -dest:apphostconfig="Default Web Site" -replace:objectName="metaProperty",scopeAttributeName="name",scopeAttributeValue="Path",targetAttributeName="value",match="d:",replace="c:" -verbose -whatif > msdeploysync.log

However, the -whatif does not show the path changed to C: and also if i run the command, i get message saying "Device not ready" which means that the D: replace is not working.

i am stuck.. any help ?

1

1 Answers

3
votes

The provided mechanism for changing the path (in a non-IIS version specific way, mind you) is to set a parameter of kind DestinationVirtualDirectory:

-setParam:kind=DestinationVirtualDirectory,scope="Default Web Site",value="c:\full\path\to\website"

If you would like to strick to simply replacing the drive, try changing your replace directive to this:

-replace:objectName=virtualDirectory,scopeAttributeName=physicalPath,match=^C:,replace=D:

Here's some official docs on the various parameter types: Using declareParam and setParam