This tool automates the process of migrating a dashboard from a development (dev) environment to a production (prod) environment within Apache Superset. It streamlines the workflow by using environment variables for configuration and requires a .env
file to store sensitive information securely.
- Authenticate against both dev and prod Superset instances.
- Export a dashboard from the dev instance.
- Import the exported dashboard into the prod instance.
- Python 3.x
python-dotenv
package for loading environment variables.- Access to both dev and prod Superset instances.
-
Clone the repository or download the source code.
-
Ensure Python 3.x is installed on your system. You can verify this by running
python --version
in your terminal. -
Install the required Python packages. Run the following command in your terminal:
pip install python-dotenv requests
-
Create a
.env
file in the root directory of the project with the following content:SUP_RESET_URL_DEV=<Your Dev Superset URL> SUP_RESET_URL_PROD=<Your Prod Superset URL> DEV_USERNAME=<Your Dev Username> DEV_PASSWORD=<Your Dev Password> DEV_AUTH_METHOD=<Your Dev Auth Method> PROD_USERNAME=<Your Prod Username> PROD_PASSWORD=<Your Prod Password> PROD_AUTH_METHOD=<Your Prod Auth Method>
Replace the placeholder values with your actual Superset credentials and URLs.
To run the script from the command line, execute:
python main.py