cki_tools.grafana
Tool to backup and restore Grafana data
Downloads configuration into locally stored YAML files, which can be later be modified and re-uploaded.
python3 -m cki_tools.grafana download|upload [--path PATH]
-
downloaduses the Grafana API to download datasources, folders, dashboards, and organization preferences and saves them to PATH. -
uploadtakes the YAML files stored in PATH and restores them to the Grafana server.
Synced objects:
| Object | Directory | Identifier |
|---|---|---|
| Datasources | datasource/ |
uid (portable across instances) |
| Folders | folder/ |
uid |
| Dashboards | dashboard/ |
uid |
| Org preferences | preferences/org.yml |
single file |
GRAFANA_URL and GRAFANA_TOKEN environment variables need to be configured.
Follow the instructions on the Grafana Docs to learn how to get an API Token.