msdeploy - Cannot create a file when that file already exists

141 Views Asked by At

We are trying to migrate IIS 10 from one server to another server with the command:

msdeploy -verb:sync -source:webServer,computername=academicApp01T -dest:webServer,computername=WEBAAPPT01WA, -enablelink:AppPoolExtension -disableLink:Content -replace:objectName=metaProperty,scopeAttributeName=name,scopeAttributeValue="ServerBindings",match=sourceIP,replace=newdestinationIP

but we keep getting the error below. We installed msdeploy "complete" (as opposed to custom or typical)

C:\Program Files\IIS\Microsoft Web Deploy V3>msdeploy -verb:sync -source:webServer,computername=academicApp01T -dest:webServer,computername=WEBAAPPT01WA, -enablelink:AppPoolExtension -disableLink:Content -replace:objectName=metaProperty,scopeAttributeName=name,scopeAttributeValue="ServerBindings",match=sourceIP,replace=newdestinationIP
Info: Using ID 'ab29a6b0-c2d7-4e0c-afad-f410a54db50c' for connections to the remote server.
Info: Using ID '830a233d-98f3-4a9a-ab8e-c4437cb94b92' for connections to the remote server.
Info: Updating section (MSDeploy.webServer/webServer/appHostConfig[@path='']/configSections/sectionGroup[@name='system.webServer']/section[@name='httpCompression']).
Info: Adding child appHostConfig (MSDeploy.webServer/webServer/appHostConfig[@path='']/location[@path='']).
Error: (12/28/2023 9:36:54 AM) An error occurred when the request was processed on the remote computer.
Error: Cannot create a file when that file already exists. (Exception from HRESULT: 0x800700B7)
1

There are 1 best solutions below

2
samwu On

Cause:

Duplicate schema configuration xml file exists in "C:\Windows\System32\inetsrv\config\schema" folder.

Resolution:

Remove the duplicate schema configuration xml file from "C:\Windows\System32\inetsrv\config\schema" folder and restart WAS service.

NOTE: This same error shown when WAS fails to start can happen for different but similar schema file related issues, so it is imperative to identify which schema file is causing the issue - and Procmon trace can help with that.

More information you can refer to this link: Cannot create a file when that file already exists.