- URL:
- https://<root>/importSite
- Methods:
POST- Version Introduced:
- 10.2
Access requirements
Required privileges
The Sever Administrator API requires privilege-based access. An administrator must be assigned a specific user privilege, or role, to access any given endpoint. Listed below are the user privileges or roles an administrator can be assigned that provides access to this endpoint. If multiple privileges are listed, only one needs to be assigned to gain access.
Note that administrators assigned a custom role must also have the administrative View all content privilege assigned to them to access the API directory as an administrator.
Tokens
This API requires token-based authentication. A token is automatically generated for administrators who sign in to the Server Administrator API directory's HTML interface. Tokens generated in this way are stored for the entirety of the session.
Those accessing the API directory outside of the HTML interface will need to acquire a session token from the generate operation in the Portal Directory API. For security reasons, all POST requests made to the Server Administrator API must include a token in the request body.
Description
The import operation imports a site configuration into the currently running site. Importing a site means replacing all site configurations (including GIS services, security configurations, and so on) of the currently running site with those contained in the site configuration file. The site configuration file can be obtained through the Export Site operation, which writes the information to either a file location accessible to ArcGIS Server or to a directory where you can download the configuration file.
The import operation also restores a site from a backup that was created using the export operation. The import operation uses the server directory paths from the exported configuration. These paths must be available for the import operation to complete successfully.
This operation will restore all information included in the backup, as described in Export Site. Once the import is complete, this operation returns a report that should be reviewed. Fix any problems listed in the report to ensure that the site functions as expected.
Request parameters
| Parameter | Details |
|---|---|
(Required) | The folder path to an exported configuration, or an ID referencing the stored configuration on the server. Starting at ArcGIS Enterprise 12.0, if the exported configuration was sent to a cloud-based storage location, the |
(Optional) | Introduced at ArcGIS Enterprise 12.0. This parameter defines the location configuration for a file store or cloud-based storage systems. If ArcGIS Server is configured to use cloud-based storage, the JSON object must contain connection information, such as bucket, container, credential, and cloud region information. If this parameter is not defined, or if ArcGIS Server is not configured with cloud-based storage, the parameter will use the file store configuration. The following is sample input for file store configurations. Example |
| Introduced at ArcGIS Enterprise 11.1. This parameter validates the file path specified in the Values: |
| Introduced at ArcGIS Enterprise 11.3. This parameter specifies whether the server should restart once the operation completes. It's recommended to enable the server to restart ( Values: |
| Introduced at ArcGIS Enterprise 12.0. This parameter specifies whether the operation is performed asynchronously. If set as Values: |
| The response format. The default response format is Values: |
Example usage
The following is a sample POST request for the import operation:
POST /<context>/admin/importSite HTTP/1.1
Host: organization.example.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []
location=\\server\share\backup\Jan-15-2023_11-50-33.agssite&locationConfig={"type": "fileStore","provider": "FileSystem"}&validate=true&async=false&f=pjsonJSON Response examples
The response below highlights the server's failure to start a service during the import operation. For demonstration purposes, a service's input data path was edited to point to a nonexistent file before exporting the site. The same exported configuration file was supplied as input to the import operation. When import completes, the response warns that a service could not be started during the import operation because the file could not be found. This information can be used to fix the issue by editing the data path of the service and running it again.
{
"status": "success",
"result": [
{
"source": "SITE",
"messages": [
{
"level": "INFO",
"message": "This operation completed in 1.52 mins"
}