Solved! Go to Solution.
Sorry to bring up an older thread but I've been trying to get this script / tool to work as we migrate to three new ArcGIS Server VMs. I made many of the updates you recommended, but am a little stumped as to why this script is still failing on our side. When I run the tool, it fails with the following directories and locations identified. I'm attempting to migrate (in this example just one service) from our old server (southerly) to our new Dev Server (DEQ-GIS-DEV) and it's failing with Service MXD not found error as seen below:
Executing: TransferServices southerly 6080 ***** ***** MapServer public//2018_adb_anyuse.MapServer DEQ-GIS-DEV 6080 ****** ****** # \\DEQ-GIS-DEV\C$\arcgisserver\directories\arcgissystem\arcgisinput\sysTemp # \\DEQ-GIS-DEV\C$\arcgisserver\directories\arcgissystem\arcgisinput\backup
Start Time: Tue Sep 17 14:06:17 2019
Running script TransferServices...
** Service 'public//2018_adb_anyuse.MapServer' information read successfully. Now transfering... (5 steps)
pathInitial line 581: C:\arcgisserver\directories\arcgissystem\arcgisinput\public\2018_adb_anyuse.MapServer\extracted\v101\final_2018_adb_anyuse.msd
pathInitial line 657: C\arcgisserver\directories\arcgissystem\arcgisinput\public\2018_adb_anyuse.MapServer\extracted\v101\final_2018_adb_anyuse.msd
msdPath line 659: \\southerly\C\arcgisserver\directories\arcgissystem\arcgisinput\public\2018_adb_anyuse.MapServer\extracted\v101\final_2018_adb_anyuse.msd
simpleServiceName line 668: 2018_adb_anyuse
finalServiceName line 672: public//2018_adb_anyuse.MapServer
inputFolderPath line 691: \\southerly\C\arcgisserver\directories\arcgissystem\arcgisinput\public\2018_adb_anyuse.MapServer
inputFolderPath line 693: \\southerly\C\arcgisserver\directories\arcgissystem\arcgisinput\public\2018_adb_anyuse.MapServer
\\DEQ-GIS-DEV\C$\arcgisserver\directories\arcgissystem\arcgisinput\sysTemp\2019917_14617_southerly_DEQ-GIS-DEV\
Directory not copied. Error: [Error 67] The network name cannot be found: u'\\\\southerly\\C\\arcgisserver\\directories\\arcgissystem\\arcgisinput\\public\\2018_adb_anyuse.MapServer\\*.*'
Service MXD not found.
***************************************************************************
- Number of services in 'southerly': 19
- Number of services selected in 'southerly': 1
- Number of services transfered successfully to 'DEQ-GIS-DEV': 0
- Number of services not transfered to 'DEQ-GIS-DEV': 1
- The migration backup is placed in: \\DEQ-GIS-DEV\C$\arcgisserver\directories\arcgissystem\arcgisinput\sysTemp\2019917_14617_southerly_DEQ-GIS-DEV\
***************************************************************************
Completed script TransferServices...
Succeeded at Tue Sep 17 14:06:18 2019 (Elapsed Time: 1.76 seconds)
When I check the logs, I see:
***************************************************************************
Publishing in Server: DEQ-GIS-DEV Port: 6080 AdminUser: *****
2019-09-17 14:06:17
***************************************************************************
2019-09-17 14:06:18
Service MXD not found.
- public//2018_adb_anyuse.MapServer
I don't understand why the script seems be looking at the \\DEQ-GIS-DEV\C$\arcgisserver\directories\arcgissystem\arcgisinput\sysTemp\2019917_14617_southerly_DEQ-GIS-DEV\ directory in the temp for the .mxd... or perhaps why it failed to find and copy it to begin with where the .mxd exists on the origin server at (for this service): C:\arcgisserver\directories\arcgissystem\arcgisinput\public\2018_adb_anyuse.MapServer\extracted\v101\fnal_2018_adb_anyuse.mxd but when I check sysTemp on the new server- sure enough public\ is empty.
So I'm a little stumped as to why the script seems to be having issues locating the source .mxd. The syntax in the python script seems to be here to look for the .mxd:
#If the data copied ok
if continuePublish == True:
mxdExist = False
#Check for MXD
for root, dirs, files in os.walk(pathInitial):
for file in files:
if file.endswith(".mxd"):
mxdFile = os.path.join(root, file)
mxdExist = True
break;
Anyone have any thoughts or luck on this? Thanks for any help you can provide!
If you are using ArcGIS Server 10.6 or 10.7 this simple option might work for you as it did work for me recently.
I needed to move our maps services from ArcGIS 10.6 single server to ArcGIS 10.7 federated with Portal.. The script posted here did not work for me, though it worked perfectly well when i was moving from 10.5.1 standalone server environment to 10.6.1 standalone server environment.
If you are getting a Network Error, Just check the ports of the servers. I did experience that error when i was working with the stand alone server , if the ports are incorrect, you will get that error
So in my new situation what i did was to simply upgrade the ArcGIS 10.6.2 standalone server to ArcGIS 10.7, so i now have both servers running the same ArcGIS Server version which is 10.7. Then to move the map services across, I use the export and import tools in the Admin server and it worked very easily for me.
I do not know the ArcGIS Server environment you are working with but it is good to note that the script we are discussing above works only for Standalone server environment and cannot work for a federated server environment
Thanks for replying Irene! Apologies as I should have mentioned our environment earlier. We are using a standalone (for the time being) ArcGIS Server 10.4.1 and transferring to a standalone 10.4.1 ArcGIS Server- both with Web Adapters co-located on the same boxes. I think the default ports @6080 are working as the tool is able to retrieve a valid list of services from the origin server... I'm really stumped as to why it's unable to locate the service .mxds though.
I have a few suspicions that I might test out specific to our environment / past practices:
All of these should be easy enough to test out. Thanks again for any ideas you might have!
Rex,
"When the origin ArcGIS Server was configured, it looks like admin access through Web Adapter was disabled... so I'm wondering if this is blocking the script from accessing some required contents through the server/arcgis/ Web Adapter endpoints"
I'm thinking this could be a problem, Is there a way you can enable this admin access again and run the script once more because you really need an username and password with admin rights. If it fails then we would know that the issue might most probably be on the script.
I'm not sure if you have read the documentation provided by the original developers of that script. I will try and past some of the information here for you.
The script has 12 parameters and here are the descriptions and requirements. I'm hoping by the time you go through the document below you will be able to identify the issue but if you still are not able to resolve it, we can move on to the next level of critically looking at what you have on your modified script
The script uses twelve parameters. Only one of them is optional:
[1] Input Server Name (string)
The host name of the origin server. Typically a single name or fully qualified server, such as myServer.esri.com
[2] Input Server Port (string)
The port number for the origin ArcGIS Server. Typically this is 6080. If you have a web adapter installed with your GIS Server and have the REST Admin enabled you can connect using the web servers port number.
[3] Input Server User (long)
Administrative username.
[4] Input Server Password (string)
Administrative password.
[5] Service Type (string)
The type of the service to migrate.
[6] Services (Multiple Value)
One or more services to perform an action on. The tool will autopopulate with a list of services when the first 5 parameters are entered. Service names must be provided in the <ServiceName>.<ServiceType> style.
[7] Output Server Name (string)
The host name of the end server. Typically a single name or fully qualified server, such as myServer.esri.com
[8] Output Server Port (long)
The port number for the final ArcGIS Server. Typically this is 6080. If you have a web adapter installed with your GIS Server and have the REST Admin enabled you can connect using the web servers port number.
[9] Output Server User (string)
Administrative username.
[10] Output Server Password (string)
Administrative password.
[11] (optional) Folder (string)
A destination folder different from the original/s one/s can be introduced.
[12] sysTemp (string)
A folder where the services sources are going to be stored.
The script uses the username and the password to connect to the original and destination server with a generatetoken action. After accessing to the original server, all services are listed. When the user selects the services to migrate and fills all the parameters the process starts.
Firstly, a copy of the selected service's sources is made, this copy is placed in the sysTemp path. After that, all the service's properties are read and modified in the copy done in the sysTemp path.
The tool checks if in the destination server exists a folder with the same name as the original one, or with the name defined as a parameter. If not the folder is created. Once the folder is created the tool publish the service using the copied sources.
Is important to notice that if the service has special permission (cannot access to it everyone), also this permission is set in the new service. The procedure is:
Note: When the users are copied from one server to another it is not possible to transfer the password of the user so is set by default.
Below are ESRI recommendations for migrating services between two machines (it will work in either same AGS version or different version)
Commented on a different post on this, I'll provide a link here:
We are working in package to automate the copy of services between ArcGIS Servers. The package and some scripts are available here GitHub - jbelo-pro/arcser-admin: ArcGis administration
So far this just support Map Services and Geocode Services