Import Site

URL:
https://<root>/importSite
Methods:
POST
Required Capability:
Access allowed only with the default administrator role
Version Introduced:
10.4

Description

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.

Token expiration when importing site

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
Use dark colors for code blocksCopy
1
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:

Use dark colors for code blocksCopy
1
2
3
4
5
6
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

Example one: success response

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:

Use dark colors for code blocksCopy
1
2
3
{
  "status": "success"
}

Example two: failure response

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:

Use dark colors for code blocksCopy
1
2
3
4
5
{
  "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
}

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