Error in Sync Server using Web Deploy PowerShell Cmdlets

This topic contains 2 replies, has 2 voices, and was last updated by  Pawan Dubey 1 week ago.

  • Author
    Posts
  • #84139

    Pawan Dubey
    Participant

    I am trying to sync two web servers using below commands (reference link)

    $src_publishing_file = Join-Path $ENV:TEMP ("{0}.publishsettings" -f $ENV:COMPUTERNAME)
    
    $dst_site='testDeployement'
    
    New-WDPublishSettings -ComputerName $ENV:COMPUTERNAME -AgentType MSDepSvc -FileName $src_publishing_file -Site $dst_site
    
    $computer='computerName'
    
    $dst_publishing_file = Join-Path $ENV:TEMP ("{0}.publishsettings" -f $computer)
    
    New-WDPublishSettings -ComputerName $computer -AgentType MSDepSvc -FileName $dst_publishing_file -Site $dst_site
    
    Sync-WDServer -SourcePublishSettings $src_publishing_file -DestinationPublishSettings $dst_publishing_file
    

    I am getting below error, and I don't know why its not working (however normal Copy-Item command is working fine).

    Sync-WDServer : (11/13/2017 4:28:38 AM) An error occurred when the request was processed on the remote computer.
    Cannot create a file when that file already exists. (Exception from HRESULT: 0x800700B7)
       at Microsoft.Web.Deployment.IAppHostConfigLocationCollection.AddLocation(String bstrLocationPath)
       at Microsoft.Web.Deployment.AppHostConfigProvider.AddChild(DeploymentObject source, Int32 position, Boolean whatIf)
       at Microsoft.Web.Deployment.DeploymentObject.AddChild(DeploymentObject source, Int32 position, DeploymentSyncContext syncContext)..............
    

    Please share your thoughts on this

  • #84151

    Richard Siddaway
    Moderator

    Reading the error message the first thing is to check if there's an old copy of the file on the target. Maybe do a test-path on the target and delete if its present

    • #84161

      Pawan Dubey
      Participant

      Hi Richard,
      There is no old copy of data. And the purpose of using Sync-WDServer command it that it itself checks that and does everything.
      Regards,
      PD

You must be logged in to reply to this topic.