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]
  • download uses the Grafana API to download datasources, folders, dashboards, and organization preferences and saves them to PATH.

  • upload takes 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.