Exporting and importing configuration in ZIP format is a convenient technique for performing the following tasks:
Backing up and restoring all search configuration. For information, see Back up and restore all application search configuration.
Migrating all search configuration from one environment to another – for example, from a test environment to a production environment. For information, see Migrate your configuration of search features.
You can also use ZIP format to configure individual resources. For information, see Configure individual resources using ZIP format.
Note: The ZIP format can be used with any resource path in the system. The examples in this section represent only a few of the configurable search resources that can be accessed in ZIP format.
Export Configuration
When configuration is exported in ZIP format, the configuration is downloaded in a ZIP file, and the body of the response message contains ZIP data. The ZIP file contains folders and JSON files that match the resourcePath
structure of the Search and Navigation REST API. The exported folder structure matches the URL resource paths.
When the ZIP file is downloaded through a browser client, it is saved to the default downloads location of the browser. If the ZIP file is downloaded programmatically, your client application must determine how to handle the ZIP file.
A GET request to export configuration using ZIP format is of the following form:
GET /gsadmin/v1/cloud/resource
Path
.zip
where:
resource
Path
specifies the location of the particular resource to the exported.
.zip
indicates that ZIP format is used. The.zip
extension can be used only with theGET
command.
The following are examples of GET requests in ZIP format:
GET http://host:port/gsadmin/v1/cloud.zip
(Exports the entire search configuration for the cloud application.)
GET http://host:port/gsadmin/v1/cloud/thesaurus.zip
(Exports the entire thesaurus for the cloud application.)
GET http://host:port/gsadmin/v1/cloud/searchInterfaces/All.zip
(Exports configuration for the search interface namedAll
.)
Import Configuration
A request to import configuration using the ZIP format is of the following form:
POST /gsadmin/v1/cloud/resourcePath
Content-Type: application/zip
:file=*** ZIP DATA HERE ***
where ZIP DATA
is in a :form
parameter included in the body of the request.
For example, the following POST request imports configuration of the search interface ALL
:
POST http://host
:port
/gsadmin/v1/cloud/searchInterfaces/All
Content-Type: application/zip
*** ZIP DATA HERE ***
When used with ZIP format, POST first scans the zip file for viruses and unsupported file types. It then validates the contents of each json file to make sure that the contents are syntactically correct. If any of that fails, then an error is returned. If successful, the contents of the resource at resourcePath
are fully replaced by contents in the specified zip file.
Important: The ZIP file content that you import entirely replaces any existing configuration at resourcePath
. Thus, if you import only the configuration for a thesaurus into /cloud
(rather than into /cloud/thesaurus
), all existing search configuration at /cloud
will be replaced by the configuration of the thesaurus alone.