How copy map service from one ArcGIS server to another ArcGIS server

31898
26
Jump to solution
03-25-2013 02:19 AM
Rakibul_IslamRoni
New Contributor
Hi, I need to copy Map service which is created in ArcGIS server 10.1 (sp1), to another ArcGIS server (10.1 sp1) machine. I am trying to do this process manually by copying service file from C:\arcgisserver\config-store\services and C:\arcgisserver\directories\arcgiscache and *.JSON files. Service can read by new machine but cannot start the service. So please give a direction that how can i do this work.
Tags (2)
26 Replies
RexRobichaux
Occasional Contributor

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! 

0 Kudos
IreneEgbulefu1
New Contributor III

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

RexRobichaux3
New Contributor III

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:

  1. First is that most of our legacy services in the past were published from local client locations vs shared network locations (we have since changed that workflow). I wouldn't think that should matter since the service .mxd is still located / copied to the ArcGIS Server under the respective C:\arcgisserver\directories\arcgissystem\arcgisinput\service directories but you never know.
  2. 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.
  3. When we publish, we typically don't publish directly to server, but rather create service definition files, then through Server Manager we create services from the .sd files as this plays a little nicer with some of our web mapping applications... although doubtful, I'm wondering if this is somehow coming into play.

All of these should be easy enough to test out. Thanks again for any ideas you might have!

0 Kudos
IreneEgbulefu1
New Contributor III

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

 

Functionality

 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:

  • In case the role exists in the destination server: Only the access permission is assigned to the service.
  • In case the role does not exists in the destination server: The role is created with the same characteristics of the original one, the role privileges are assigned to the role and the users within that role are transferred.

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.

0 Kudos
AbhishekSharma1
New Contributor II

rastrauch

Below are ESRI recommendations for migrating services between two machines (it will work in either same AGS version or different version)

 

0 Kudos
JonathanQuinn
Esri Notable Contributor
JavierBelo1
New Contributor II

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

0 Kudos