The import_dashboard Module
Import a native Superset dashboard bundle, re-pointed onto a local connection
ON THE FLY (console script: import_dashboard).
Why on the fly: a native bundle binds its datasets to a connection by uuid,
and that uuid is assigned per-instance – so a committed bundle cannot hard-code
it or it would only import on the machine it was exported from. This tool
instead resolves the connection BY NAME via the REST API, rewrites the bundle
into a throwaway temp zip bound to that uuid, and imports that. The source
bundle on disk is never modified.
By default object uuids are PRESERVED, so the import UPDATES the dashboard the
bundle represents (idempotent: re-importing the same bundle, or an
export->edit->import round-trip, never duplicates charts/datasets). It binds to
the DORIEH connection unless –connection-name says otherwise.
Use –copy to stand up an INDEPENDENT dashboard on another connection (e.g. a
DORIEH2 dev comparison) that coexists with the canonical one: object uuids
are regenerated deterministically per connection name. Do NOT use –copy for the
canonical bundle you export/refresh – regenerated uuids compound across
export->import cycles and cause duplicates.
Examples:
import_dashboard path/to/medicare_quality_dashboard
import_dashboard bundle.zip --connection-name DORIEH2 --copy \
--dashboard-name "Medicare Demo Quality Dashboard (DORIEH2 dev)"
import_dashboard bundle/ --base-url http://localhost:8088/ --username admin