Qui
Qui

Reputation: 53

Duplicate a Superset dashboard, then replace its dataset source at once?

I am using Superset for data visualisation and I'm used to upload a csv file for each dataset I need. My issue is when I want to duplicate a dashboard and replace the datasource only for the copied dashboard. In practice I export the dashboard that I want to copy, then import it, and change the dataset for each graph of the dashboard. This task can be quite time-consuming and I would like to know if there is any way to change the dataset source in the duplicated dashboard for all its graphs at once?

Upvotes: 5

Views: 12187

Answers (3)

saj_python_n00b
saj_python_n00b

Reputation: 21

Suddjian's answer about replacing uuids is on the right track, but charts have a "datasource" parameter that is unique to the underlying dataset. This "datasource" parameter doesn't seem to be part of the exported dataset metadata. It is assigned when the dataset is created, though it can be modified (thru the UI, at least).

Upvotes: 2

Connor Dibble
Connor Dibble

Reputation: 595

You can also just open the existing Dashboard and then Save As. This provides an option to also duplicate the underlying Charts (or not). See: https://github.com/apache/superset/issues/4963

Upvotes: 5

suddjian
suddjian

Reputation: 2396

Dashboards are exported as a zipped archive of yaml files. You could use a text editor to find-and-replace the dataset id in the exported files before importing.

Upvotes: 1

Related Questions