Exporting and Importing Models

Applicable to Sisense on Linux and Microsoft Windows

You can export and import your ElastiCube data and live data models into Sisense. In Windows and Linux deployments, models can be exported as .smodel files. The .smodel file contains the design of your model’s schema and its connection settings to its sources. For Linux deployments, you can select to export a .sdata file, instead. The .sdata file contains the design of your model’s schema, connection settings to its sources, and the data itself.

Exporting a Model in Windows

To export a model:

  1. Open the Data page.
  2. For the relevant ElastiCube or Live model, select >Export Model.

    You're prompted to download the schema in an .smodel file.

Importing a Model in Windows

To import a model:

  1. Open the Data page.
  2. Click Import Model.
  3. Drag your .smodel file to the Import dialog box.
    OR
    Click Browse. Navigate to the relevant .smodel file and select it.
  4. If a model with the same name already exists, either rename the model or overwrite the existing model with the one you're importing.

    The schema is displayed and the model is added to the Data page. Build the model (in the case of ElastiCubes) and publish the model (in the case of a live model) so you can work with it in your dashboard.

Exporting a Model in Linux

You might want to export a model to use it as a backup, as a base for another ElastiCube, or to load it onto a different Sisense server.

To export a model:

  1. Open the Data page.
  2. For the relevant ElastiCube, select > Export Model.
  3. Select whether to export only the model schema (A) or the model schema and the data (B).
  4. Click Export.
    You're prompted to download a file:
    • If you're exporting the model only (A), you'll be prompted to download a .smodel file
    • If you're exporting the model and data (B), you'll be prompted to download a .sdata file

Notes:

Importing a Model in Linux

To import a model:

  1. Open the Data page.
  2. Click Import Model.
  3. Drag a .smodel file (model only) or .sdata file (model and data) to the Import dialog box.

  4. OR

    Click Browse. Navigate to the relevant .smodel or .sdata file and select it.

  5. If a model with the same name already exists, either rename the model or overwrite the existing model with the one you're importing.

The schema is displayed and the model is added to the Data page. Build the model so that you can work with it in your dashboard. If you imported a .sdata file, you can view the data immediately, without needing to perform a build.

Export and Import a Data Model with the API

You can export and import a data model using the Sisense API, but the connection parameters - including the password - are encrypted. For exporting, decrypt the connection parameters and password. For importing to Sisense, you'll need to encrypt the connection parameters and password.

"connection": {

"id": "<ID>",

"provider": "<DATA SOURCE, SUCH AS POSTGRESQL>",

"parameters": "qkSH7KtgPqA3l16Bc4PMfY8aBq6T8NwbcbsRJALbCbrxl7AZHrHYCVegTY5Xw8f7RUzVk2PvOXe0kbDTI=DvjQ1nJaJc8sQRGcVMWjXwPPsHXJ=0uDpZH3hoWgR76MvW4QRCkMtWUrQ1ZSfrFRKfbgTM1vW=N9Ahf3uAe2lCylhRwFIyDemMeDVa7ThBcWWzmbR=GMrUHarwwvummwfY4xlvyEbWPvptrAOByHsOabhIoegKTxkRyBlrfo0AtqvCFfy1lAmgRUFvdaO3KkO9pXSD”,

"schema": "public",

"fileName": null,

"timeout": 300,

"autoRefresh": null,

"refreshRate": null,

"resultLimit": null,

"protectedParameters": [

"Password"

],

"uiParams": {},

"globalTableConfigOptions": {}

}

In all versions of Sisense for Linux and in Sisense for Windows version 8.1.1 and later you can use # GET api/v1/encryption/decrypt to decrypt the hashed parameters string:

  1. From the Admin tab, in the menu under System Configuration, click REST API.
  2. Make sure Version 1.0 is open and click encryption.
  3. To decrypt the AES key value, click GET /encrypt/decrypt.
  4. Click Try it out.

  5. In the value field, enter the encrypted parameters string.

  6. Click Execute.

The response body shows all of the decrypted parameters, except for the password, which is still encrypted.

To decrypt the password, copy the encrypted password hash and decrypt it in the same way.

Once you have this information, you can replace the password in the .smodel file and import it into Sisense.

Note: You can send the connection parameters in the “parameters” value pair, and not as “protectedParameters” (which still needs to be sent as an empty array).

For example:

"connection": {

"id": "<ID>",

"Parameters":{

"Server":"<SERVER ADDRESS>",

"Database":"<DATABASE NAME>",

"UserName":"<USER NAME>",

"Password":"<PASSWORD>"

},

"provider": "<DATA SOURCE, SUCH AS POSTGRESQL>",

"schema": "public",

"fileName": null,

"timeout": 300,

"autoRefresh": null,

"refreshRate": null,

"resultLimit": null,

"protectedParameters":[],

"uiParams": {},

"globalTableConfigOptions": {}