« Previous Next »

Thread: ReplaceHandler not working, rule or command

Last post 12-30-2008 5:07 PM by yaminij. 4 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (5 items)

Sort Posts:

  • 12-16-2008, 4:29 PM

    ReplaceHandler not working, rule or command

    Hi
    I've been using msDeploy for a feww days and it's working fine, except the replace rule, i am not able to execute the rule correctly. I have tried command, rule in configuration file and nothing has worked. Here is my last rule.

    <configuration ><rules ><rule name="ReplaceIPAddressInBinding" type="Microsoft.Web.Deployment.DeploymentReplaceRule" enabled="true" objectName="IIsWebServer" scopeAttributeName="ServerBindings" scopeAttributeValue="192\.168\.99\.100[:\n\c\.\wA-Z]*" targetAttributeName="bindingInformation" match="192\.168 \.99\.100" replace="127.0.0.1" ></rule></rules></configuration>

    I have also tried :

    <configuration><rules ><rule name="ReplaceIPAddressInBinding" type="Microsoft.Web.Deployment.DeploymentReplaceRule" enabled="true" targetAttributeName="bindingInformation" match="192\.168\.99\.100" replace="127.0.0.1" ></rule></rules></configuration>
    or

    <configuration><rules ><rule name="ReplaceIPAddressInBinding" type="Microsoft.Web.Deployment.DeploymentReplaceRule" enabled="true" targetAttributeName="bindingInformation" match="192\.168\.99\.100" replace="127.0.0.1" ></rule></rules></configuration>

    and

    <configuration><rules ><rule name="ReplaceIPAddressInBinding" type="Microsoft.Web.Deployment.DeploymentReplaceRule" enabled="true" objectName="metaProperty" targetAttributeName="bindingInformation" match="192\.168\.99\.100" replace="127.0.0.1" ></rule></rules></configuration>

    my command line is

    msdeploy -verb:migrate -source:metakey =LM/W3SVC/719185767,computerName=http://192.168.99.100:8081/msdeploy/ -dest:meta key=LM/W3SVC/719185767/ -disableLink:ContentExtension -verbose

    i have also try to add command line

    replace -replace:ObjectName=metaProperty,targetAttributeName=bindingInformation,match=192\.168\.99\.100,replace=192.168.0.9

    nothing work, anybody know why ?
    Cédric Boivin
    Analyste - Programmer
  • 12-17-2008, 8:34 AM In reply to

    I find a part of the solutions

    Hello,
    I find a part of the solutions, when i specify an targetAttributeName="bindingInformation" it's not work. But if i don't specify, my rule will be apply for all destination right ? There is the replace rule working but not for a specific destination.

    <rule name="ReplaceIPAddressInBinding" type="Microsoft.Web.Deployment.DeploymentReplaceRule" enabled="true" objectName="metaproperty" scopeAttributeValue="192\.168\.99\.100" match="192\.168\.99\.100" replace="192.168.0.9" />

    How could i specify the target destination ?

    I try to change a specific match group with the replace rule

    <rule name="ReplaceDomaineNameCom" type="Microsoft.Web.Deployment.DeploymentReplaceRule" enabled="true" objectName="metaproperty" scopeAttributeValue=":80:[\wA-Z\.\(\)]*" match="\.[com|ca|qc\.ca|org]" replace=".locale.$1" />

    I want all my .com, .ca, .qc.ca .org change for .locale.com, .locale.ca, .locale.qc.ca, locale.org. RegEx suport the group replace with $1 for the first group and $2 for the second group etc.. can i do that with msdeploy ?

    Cédric Boivin
    Analyste - Programmer
  • 12-17-2008, 8:35 AM In reply to

    Re: Je n'arrive pas à faire fonctionner le -replace (Désoler pour le francais)

    Err repost this in English please.
    Cheers,
    Bernard Cheah
  • 12-17-2008, 1:48 PM In reply to

    Re: I find a part of the solutions

    I found the way to do what i am trying to do. But there a bug with the destination. I hope Microsoft could answer or repair this bug before release.
    2 points
    First if i create more that one rule on the same attribute only the last one apply, maybe because they always make the replace from the source and not from the first modify source rule.
    Second one, the targetAttributeName not working for me and I dont know why.
    There is my solution

    I want to replace every ip address 192.168.99.100 to 192.168.0.9 and every domain extention to domain.locale.extension. The only way i could do that is like this:
    <rule name="ReplaceIPAddressInBinding" type="Microsoft.Web.Deployment.DeploymentReplaceRule" enabled="true" objectName="metaproperty" scopeAttributeValue="192\.168\.99\.100" match="192\.168\.99\.100(:80:[\wA-Z\.\(\)]*\.)(com|ca|org|qc\.ca)" replace="192.168.0.9$1locale.$2" />

    If i add targetAttributeName="bindinginformation" the rule dont work. Is it a bug ??
    Cédric Boivin
    Analyste - Programmer
  • 12-30-2008, 5:07 PM In reply to

    Re: I find a part of the solutions

    Your source looks like it is an IIS 6.0 machine. When you do a dump of IIS 6.0 using webserver60 provider in xml format, the bindings info will look like this

    <metaProperty name="ServerBindings" propertyId="1023" attributes="None" userType="1" dataType="MultiSz" value=":80:" />

    bindingInformation property does not exist in the above format. I am guessing that is why your command did not work.

    The exact command to get to ":80:" and replace it would be

    msdeploy.exe -verb:sync -source:webserver60 -replace:objectname=metaProperty,scopeAttributeName=name,scopeAttributeValue=ServerBindings,targetAttributeName=value,match=":80:",replace=":82:" -dest:webserver60,computername=<dest_machine_name>

    Thanks
    Yamini Jagadeesan, SDET, Microsoft IIS Team
Page 1 of 1 (5 items)
Microsoft Communities