- URL:
- https://<root>/importSite
- Methods:
POST
- Required Capability:
- Access allowed only with the default administrator role
- Version Introduced:
- 10.4
Description
The import
operation restores a site from a backup site configuration file that was created using the export
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 import
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 import
operation URL. If you're calling the operation from a script, include the new token in the API call.
Request parameters
Parameter | Details |
---|---|
| The file path to an exported configuration. Example
|
| Introduced at ArcGIS Enterprise 11.1. This parameter validates the file path specified in the Values: |
| The response format. The default response format is Values: |
Example usage
The following is a sample POST request for the import
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
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:
{
"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:
{
"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
}