Showing results for 
Search instead for 
Did you mean: 
Community Team Member
Community Team Member
The attached script is intended to loop through all ElastiCube folders in your ElastiCubeData folder and import them.
Business Case
This solution has a couple of possible use cases.  The first is to facilitate migrating a Sisense environment with a large number of ElastiCubes.  The second would be in the case of disaster recovery, where a number of ElastiCubes must be reattached.
Python 3 must be installed.
There should be at least one ElastiCube folder in your ElastiCubeData folder that is intended to be imported.

Step 1

Download the attached Python3 Script to your ElastiCubeData folder(usually C:\ProgramData\Sisense\PrismServer\ElastiCubeData).

Step 2

Open a IDLE (Python Editor) window as an Administrator.  Note: You will get a prompt to allow changes for each ElastiCube unless you run as an Administrator.

Step 3

Load the script into IDLE and run.  This can take some time to import all ElastiCubes depending on how many you have and the size.  Enjoy!
import os
import subprocess

def ImportEC(ECube):
    cmdline = ["cmd", "/q", "/k", "echo off"]
    cmd = subprocess.Popen(cmdline, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
    batch = b"""\
    cd C:\Program Files\Sisense\Prism
    psm ecube attach path="C:\ProgramData\Sisense\PrismServer\ElastiCubeData\ElasticubeToImport"
    set /p
    ECubeBytes = bytes(ECube, 'utf-8')
    batch = batch.replace(rb'ElasticubeToImport', ECubeBytes)
    result =
EC_List = next(os.walk('.'))[1]

for EC in EC_List:
    print('Python appending EC: ' + EC)
Version history
Last update:
‎02-15-2024 02:25 PM
Updated by:
Community Toolbox

Recommended quick links to assist you in optimizing your community experience:

Developers Group:

Product Feedback Forum:

Need additional support?:

Submit a Support Request

The Legal Stuff

Have a question about the Sisense Community?

Email [email protected]

Share this page: