Skip to content

Commit 9640aee

Browse files
committed
update readme
1 parent 759906d commit 9640aee

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,17 @@ More examples [listed here](https://github.com/rdytech/superset-client/tree/deve
6666

6767
## Duplicating Dashboards
6868

69-
The Primary motivation behind this gem was to use the Superset API to duplicate dashboards, charts, datasets across multiple database connections.
69+
One Primary motivation behind this gem was to use the Superset API to duplicate dashboards, charts, datasets across multiple database connections.
7070

7171
Targeted use case was for superset embedded functionality implemented in a application resting on multi tenanted database setup.
7272

7373
See examples in [Duplicate Dashboards](https://github.com/rdytech/superset-client/tree/develop/doc/duplicate_dashboards.md)
7474

75+
## Moving / Transferring Dashboards across Environments
76+
77+
With a few configuration changes to an import file, the process can be codified to transfer a dashboard between environments.
78+
79+
See example in [Transferring Dashboards across Environments](https://github.com/rdytech/superset-client/tree/develop/doc/migrating_dashboards_across_environments.md)
7580

7681
## Contributing
7782

doc/migrating_dashboards_across_environments.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,33 @@
22

33
In this document, we will discuss how to transfer dashboards across Superset hosting environments with the goal of heading towards an API call to automate the process.
44

5+
Current process is limited to dashboards with all datasets based on a single database connection.
6+
7+
## Short Version
8+
9+
Assuming you want to transfer a dashboard from Env1 to Env2.
10+
11+
You will need the following:
12+
- a Env1 Dashboard Export Zip file
13+
- a Env2 Database config export yaml
14+
- a Env2 schema to point your datasets to
15+
16+
Assuming your API env for ruby is setup for your target superset environment.
17+
( ie using API creds for Env2 for this example )
18+
19+
```ruby
20+
21+
new_import_zip = Superset::Services::ImportDashboardAcrossEnvironments.new(
22+
dashboard_export_zip: 'path_to/dashboard_101_export_20241010.zip',
23+
target_database_yaml_file: 'path_to/env2_db_config.yaml',
24+
target_database_schema: 'acme',
25+
).perform
26+
27+
# now import the adjusted zip to the target superset env
28+
Superset::Dashboard::Import.new(source_zip_file: new_import_file).perform
29+
30+
```
31+
532
## Background
633

734
A common practice is to set up infrastructure to deploy multiple Superset environments. For example, a simple setup might be:

0 commit comments

Comments
 (0)