Msdeploy replace attribute

五迷三道 提交于 2019-12-23 18:11:57

问题


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:


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



来源:https://stackoverflow.com/questions/12488886/msdeploy-replace-attribute

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!