Msdeploy替换属性 [英] Msdeploy replace attribute

查看:70
本文介绍了Msdeploy替换属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过msdeploy从我在源IIS 7站点上创建的包中还原目标计算机上的站点.目标服务器IIS也是IIS7. 但是,目标服务器没有驱动器D:作为物理驱动器. D:与CD行驱动器关联. 我在使用msdeploy时使用了replace属性,但是该规则不起作用. 以下是我的命令 msdeploy -verb:sync -source:package = d:\ site.zip -dest:apphostconfig =默认网站" -replace:objectName ="metaProperty",scopeAttributeName ="name",scopeAttributeValue ="Path",targetAttributeName ="value,match =" d:,replace =" c:"-verbose -whatif> msdeploysync.log

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

但是,-whatif不会显示更改为C:的路径,并且如果我运行该命令,也会收到消息设备未准备好",这意味着D:替换无法正常工作.

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 ?

推荐答案

所提供的用于更改路径的机制(请注意,以非IIS版本特定的方式)是设置类型为DestinationVirtualDirectory的参数:

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"

如果您想简单地替换驱动器,请尝试将您的replace指令更改为:

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

这篇关于Msdeploy替换属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆