Export Service

URL:
https://<root>/System/PublishingTools/GPServer/Export Service/submitJob
Methods:
GETPOST
Version Introduced:
11.4

Description

The Export Service operation exports the service definition for a map service (both by-reference and by-value) or a hosted feature service. The resulting service definition can then be published to a new ArcGIS Enterprise organization.

Whether an organization needs to move a map or hosted feature service from a Windows or Linux deployment of ArcGIS Enterprise to a deployment of ArcGIS Enterprise on Kubernetes, or is moving services from an on-premises deployment to a cloud deployment of ArcGIS Enterprise, the Export Service operation allows an organization to move their services from one system to another while conserving the service's references and any enabled extensions or capabilties. For example, a map service may have enabled extensions, such as WMS. Performing the Export Service for that map service will move the map service's configuration as a whole, keeing the extension enabled.

The tabs below outline the workflows for exporting and adding a service definition for hosted feature services and map services.

Hosted feature services

To move hosted feature services from one organization to another, perform the Export Service operation by specifying the service's name, service type, and the folder the service is located in. This operation must be performed on the hosting server. The result of the Export Service operation will be a job ID that, when appended to a modified version of the request URL, is used to access the job resource. From the job resource, access the Exported Data and use the provided URL to download the exported service definition. An example of this workflow can be seen in the JSON Response section below.

Once the service definition has been exported, add it as a new item to the target organization. After being added to the target organization, the service item can be published as normal from the ArcGIS Enterprise portal website. However, additional steps can be taken to preserve the service's item ID from the originating portal during publishing.

To preserve the service's item ID, gather the service's itemID value from the service's portal properties in the originating organization, an example of which is shown below:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
...
"portalProperties": {
  "isHosted": true,
  "portalItems": [
    {
      "itemID": "ded77a3196b74e28b12915add2caf55f",
      "type": "FeatureServer"
    }
  ]
},
...

With the item ID gathered, publish the service definition to the target organization. The service's item ID from the originating organization should be passed in the request as the value for the itemIdToCreate parameter. An example POST request for the publish operation is shown below:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
POST /webadaptor/sharing/rest/content/users/jsmith/publish HTTP/1.1
Host: machine.domain.com
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryuepCq6o7ZaemK9qe
Content-Length: []

------WebKitFormBoundaryuepCq6o7ZaemK9qe
Content-Disposition: form-data; name="itemid"

22d4ba1a9f6b4589abb7afc01212cdd0
------WebKitFormBoundaryuepCq6o7ZaemK9qe
Content-Disposition: form-data; name="file"; filename=""
Content-Type: application/octet-stream


------WebKitFormBoundaryuepCq6o7ZaemK9qe
Content-Disposition: form-data; name="filetype"

serviceDefinition
------WebKitFormBoundaryuepCq6o7ZaemK9qe
Content-Disposition: form-data; name="publishParameters"


------WebKitFormBoundaryuepCq6o7ZaemK9qe
Content-Disposition: form-data; name="buildInitialCache"

false
------WebKitFormBoundaryuepCq6o7ZaemK9qe
Content-Disposition: form-data; name="outputType"


------WebKitFormBoundaryuepCq6o7ZaemK9qe
Content-Disposition: form-data; name="itemIdToCreate"

ded77a3196b74e28b12915add2caf55f
------WebKitFormBoundaryuepCq6o7ZaemK9qe
Content-Disposition: form-data; name="f"

pjson
------WebKitFormBoundaryuepCq6o7ZaemK9qe
Content-Disposition: form-data; name="token"

<token>
------WebKitFormBoundaryuepCq6o7ZaemK9qe--

Request parameters

ParameterDetails

serviceName

(Required)

The service's name.

Use dark colors for code blocksCopy
1
serviceName=serviceToMigrate

serviceType

(Required)

The service type.

Values: MapServer | FeatureServer

serviceFolder

(Optional)

The name of the folder the service is located in.

Use dark colors for code blocksCopy
1
2
3
4
5
//Feature service example
serviceFolder=Hosted

//Map service example
serviceFolder=SeattleStreets

exportOptions

(Optional)

A set of additional options for the request. At this time, no options are available or supported.

returnZ

(Optional)

A Boolean that determines if z-values are included as part of the result. If true, z-values will be included in the results if the features have z-values. Otherwise, z-values will not be returned. The default is false.

Values: true | false

returnTrueCurves

(Optional)

A Boolean that specifies whether true curves will be returned in the output geometries (true). When false, curves will be converted to densified polylines or polygons. The default value is false.

Values: true | false

simplifyFeatures

(Optional)

A Boolean that specifies whether geometries should be simplified (true). Simplifying can siginificantly reduce the size of the response while fulfiling the accuracy needs for most analysis, espeically for complex and large geometries. The default value is false.

Values: true | false

context

(Optional)

Additional settings that affect the result of the operation:

  • outSR is the spatial reference of the output geometries.
  • processSR is the spatial reference that the model will use to perform geometry operations.
  • extent will only process features that overlap the specified extent. The output features will have an extent that is the same or larger than the extent value.

f

The response format. The default format is html.

Values: html | json | pjson

Example usage

The following are sample requests (GET and POST) for the Export Service operation:

Use dark colors for code blocksCopy
1
https://machine.domain.com/webadaptor/rest/services/System/PublishingTools/GPServer/Export%20Service/submitJob?serviceName=&serviceType=&serviceFolder=&exportOptions=&returnZ=false&returnM=false&returnTrueCurves=false&simplifyFeatures=true&context=&f=pjson

JSON Response example

The tabbed sections below outline the workflow to obtain the service's exported service defintion.

When the Export Service job request is submitted, the following JSON response is returned:

Use dark colors for code blocksCopy
1
2
3
4
{
  "jobId": "j5f3aa768e0a24dcfbdff45f379870553",
  "jobStatus": "esriJobSubmitted"
}

The value for jobId can be appended to a modified version of the request URL (shown below) to access the job resource:

Use dark colors for code blocksCopy
1
https://machine.domain.com/webadaptor/rest/services/System/PublishingTools/GPServer/Export%20Service/jobs/j5f3aa768e0a24dcfbdff45f379870553?f=pjson

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.