Content Migration (move dashboards between models / connections)

You might have made a dashboard on one connection, only to make another connection / model and realize you should have built it there. Or maybe your use case is more sophisticated, like moving a dashboard between omni environments. In either case, you’re in the right place.

The Python SDK now supports the api endpoints to make content migration a piece of cake :birthday_cake: .

You can see the script for performing migration here. But we’ll walk through the setup step by step.

First, install the python SDK. You may want to create a virtual environment first.

Optional Step 0 - Create a virtual environment

Starting in a folder you’d like the script to live in. Double check you have at least python 3.9+

python -m venv ./.venv

Activate the virtual environment:

source ./.venv/bin/activate

windows instructions

Step 1 - Pip install the sdk

pip install omni_python_sdk

Step 2 - Create the script and fill out API key and Omni Host

from omni_python_sdk import OmniAPI

api_key = '<<your api key>>'
base_url = '<<your omni host>>'

# Initialize the API with your credentials
api = OmniAPI(api_key, base_url)

# retrieve the dashboard
dashboard_export = api.document_export('<<dashboard identifier>>')
# change the dashboard model id
dashboard_export.update({'baseModelId':'<< model id of new location >>', 'folderPath':<<new folder if desired>>})
# import the modified document
api.document_import(dashboard_export)

Note: folder path can be found in the your url after the /f/…, so << your instance>>/f/foo would be “foo”

Step 4 – Run it

python <<name of your script>>.py

This will download the original dashboard, change it’s model id, and re-upload it to your personal folder.

Working with multiple Omni instances:

If you need to migrate across environments, your script may look more like this:

from omni_python_sdk import OmniAPI

api_env1 = OmniAPI('<<api key 1>>','https://<<omni host 1>>')
api_env2 = OmniAPI('<<api key 2>>','https://<<omni host 2>>')

# retrieve the dashboard
dashboard_export = api_env1.document_export('<< dashboard identifier host 1 >>')
# change the dashboard model id
dashboard_export.update({'baseModelId':'<<model id in host 2>>', 'folderPath':<<new folder if desired>>})
# import the modified document
api_env2.document_import(dashboard_export)

Hi, I am a little late to this post.

I wanted to ask if there is another way to do this rather than using the API? A lot of companies use cloud based data warehouses and often split their data across multiple cloud provider instances e.g. US, EU, APAC etc. This results in multiple Omni connections/model files.

It would be great to have a UI based approach where assuming the schema and table structures are same, the workflow could look like:
click on 3 dots for the dashboard → change model → select model → select topic → migrate.

Tools like Sisense Fusion enable end users to do this provided the schema is the same (Else they error out). Most end users will probably not be able to use the API (as they are not technical) and it will increase the work for data team.

Would love to see this implemented. It will make our workflow so much easier.
Thank you.

Thanks for the feedback Kartik – will raise this with our product team.

We do also have dynamic connections [Link] which can mitigate the need in many cases.

1 Like