Importing Decision Center data

You use a REST API method to import a Decision Center archive into a new environment.

About this task

You use two Decision Center REST API methods:
  • /v1/repository/dump/import: It imports a database archive into a new environment.
  • /v1/repository/dump/background: It checks the state of an import task that is run in the background. It returns Yes when the import is still running, and No when the import is complete.
The following parameters are available to launch the import operation:
  • backgroundMode: If set to true, it runs the import as a background task (the default setting is false).
  • eraseSchema: If set to true, it deletes and replaces the existing schema (the default setting is false).
  • file: This argument is required to specify the archive to be imported into the data source.
  • jsonMaxStringLength: Optional. This parameter specifies the maximum size of the JSON record that can get processed. The JSON maxStringLength error is shown when the data to be imported includes very large records. In this case, this parameter should be used to specify a larger limit. If no value is specified, the default value is specified by com.fasterxml.jackson.core.StreamReadConstraints.DEFAULT_MAX_STRING_LEN (5 000 000 bytes).
  • tmpDir: Optional. This parameter specifies where to save the temporary file. The archive is expanded before import and it might require a significant amount of disk space. This argument is used in case the default temporary directory does not have enough disk space available.

Procedure

The following samples show how to use the REST API methods in curl commands:

  1. Import a Decision Center archive as a background task (sample command):
    curl --insecure -u user:password -X POST "https://<hostname:port of Decision Center server>/decisioncenter-api/v1/repository/dump/import?backgroundMode=true&jsonMaxStringLength=5500000&tmpDir=/data/tmp" -F "file=@/tmp/dbdump.zip;type=application/zip"
  2. Check whether the background operation is running (sample command):
    curl --insecure -u user:password https://<hostname:port of Decision Center server>/decisioncenter-api/v1/repository/dump/background

    If the command output shows yes, the import operation is still running in the background.

    Note: This curl command gives the correct output only after the file has been fully uploaded. Therefore, it is recommended that you use the -v curl argument with the first command to get output that shows the file upload progress.

Results

You have imported your archive into new Decision Center environment.