Skip To Content
ArcGIS Developer
Dashboard

Import Site

Description

Caution:

This administrative operation is not available when accessed through a web adaptor, reverse proxy, or load balancer. This operation should be accessed using a direct URL to one of the portal machines in the site.

The importSite operation restores a site from a backup site configuration file that was created using the exportSite operation. When importing the site configuration file into the currently running portal site, all site configurations are replaced with information included in the backup file and the portal content index is updated. For more information about what is included in the backup file, see the Export Site documentation.

Caution:

This operation is computationally intensive and may run for a long time. Since this operation changes the portal site configuration completely, it is recommended that no portal items are accessed and that no administrative operations or functions are performed on the site while the operation is running.

Token expiration when importing site

Legacy:

The information in this section applies only to organizations using a deployment of ArcGIS Enterprise at version 10.8 or lower.

When using the importSite operation to restore a backup, a token is generated that will expire after an hour. If the backup is taking longer than an hour to restore, the import process will fail. To avoid this, generate a token using the Sharing API and specify the expiration time to be longer than the default time. If the Portal Admin Directory is accessed through a web browser, append the token generated through the Sharing API to the importSite operation URL. If you're calling the operation from a script, include the new token in the API call.

Request parameters

ParameterDetails
location

The file path to an exported configuration.

Example

location=\\server\share\backup\Oct-06-2018_10-20-55.portalsite
validate

Introduced at ArcGIS Enterprise 11.1. This parameter validates the file path specified in the location parameter, ensuring that it is accessible before performing the importSite operation. If set to true, the path will be validated, and the operation will return either a success response or an error message. The default value is false.

Values: true | false

f

The response format. The default response format is html.

Values: json | html | pjson

Example usage

The following is a sample POST request for the importSite operation that demonstrates validating the information provided in the location parameter:


POST /arcgis/portaladmin/importSite HTTP/1.1
Host: machine.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []

location=\\server\share\backup\Oct-06-2022_10-20-55.portalsite&validate&f=json

JSON Response example

The sample response below demonstrates a success response. For requests that do not validate the file location (validate set as false), a success response is returned when the request is performed successfully. For requests that validate the file location (validate set as true), a success response is returned when the file path specified with the location parameter is accessible to Portal for ArcGIS:


{
  "status": "success"
}

The following is a sample response that demonstrates a failed request. For this example, the validation for the specified file location failed, meaning that the location was not accessible to Portal for ArcGIS:


{
  "status": "error",
  "messages": ["Unable to read from \\server\share\backup\Oct-06-2022_10-20-55.portalsite. Verify the location is accessible and the service account running Portal for ArcGIS can read from it."],
  "code": 500
}