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?
Asked
Active
Viewed 5,017 times
3 Answers
3
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

Connor Dibble
- 517
- 3
- 13
-
They are not duplicated, just copied – artemonsh Nov 18 '22 at 08:55
1
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.

suddjian
- 1,986
- 2
- 16
- 25
-
But you also have to generate new uuids for these charts so they become unique. How to do it? – artemonsh Nov 18 '22 at 11:28
-
1use the uuid generator of your choice, there are loads of options there. Then copy/paste. Could definitely be scripted, something like "download, unzip, parse yaml, for each uuid generate&replace, write yaml". I don't know of any publicly available scripts specifically for this though. – suddjian Dec 08 '22 at 07:23
1
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).

saj_python_n00b
- 11
- 2
-
@JamesRisner removed the question from my post, but while I don't have a full answer, my comment aims to shed light on a murky issue – saj_python_n00b Feb 26 '23 at 21:06
-
I noticed. I edited also to remove more parts and leave only the answer parts. – James Risner Feb 26 '23 at 21:07
-
2You could put that question you had at the end on the OP's question or as a comment on this answer. – James Risner Feb 26 '23 at 21:08