I just tried (upload .sd --> reupload .sd with the same name) this through the Manager GUI in a federated 10.5.1 Enterprise deployment and got the error message saying you can only create new services this way.
However, I know this can be accomplished with python. I've broken up the script into two parts that can be run on your two machines, respectively:
1. Machine that creates .sd
import arcpy
import xml.dom.minidom as DOM
workspace = 'C:/TestSDCreation/'
mxdName = 'sample.mxd'
connectionFile = 'GIS Servers/arcgis on localhost_6080 (admin)'
serviceName = 'MyMapService'
summary = 'Population Density by County'
tags = 'county, counties, population, density, census'
finalMXD = arcpy.mapping.MapDocument(workspace+ mxdName)
sdDraft = workspace + serviceName + '.sddraft'
sd = workspace + serviceName + '.sd'
analysis = arcpy.mapping.CreateMapSDDraft(finalMXD, sdDraft, serviceName, 'ARCGIS_SERVER', connectionFile, True, None, summary, tags)
owType = 'esriServiceDefinitionType_Replacement'
xml = sdDraft
doc = DOM.parse(xml)
descriptions = doc.getElementsByTagName('Type')
for desc in descriptions:
if desc.parentNode.tagName == 'SVCManifest':
if desc.hasChildNodes():
desc.firstChild.data = owType
outXml = xml
f = open(outXml, 'w')
doc.writexml( f )
f.close()
if analysis['errors'] == {}:
arcpy.StageService_server(sddraft, sd)
print("Service Successfully Staged at: " + str(sd))
else:
print("SD Draft contains errors: ")
print(analysis['errors'])
print("No SD file created")
2. Machine 2. uses Python to publish the .sd
import arcpy
finalSD = 'C:\SomeFolderOnServer\someServiceName.sd'
connectionFile = 'C:\SomeFolderOnServer\GISServerConnection.ags'
arcpy.UploadServiceDefinition_server(sd, con)
print("Service successfully overwritten")
I'd test it out in your environment first, but that should do the trick