Want to download dashboard config files

hi
i want to download all my grafana dashboard config files.i want to download all config files at once
where we have to navigate to download in GUI .
Do we have any specific path in CLI . or is there bash script for this .

please help on this

1 Like

I actually wrote a script like that not too long ago you can probably use.

The way this works is you use the Grafana API (docs are here) – it has a search API which lets you identify all of the dashboards that you’ve got. You then use a different dashboard endpoint to automatically grab all of the JSON that defines the dashboard. This is the same as going into the UI, and then inspecting the dashboard and saving its JSON configuration, we’re just doing it all at once for all the dashboards.

This script will not work out of the box for you because it runs against a public Grafana. For yours, you will need to check the authorization section the API docs and in the bash script make sure that curl is submitting the right bearer authentication token, but the basic approach here will work for bulk-export all dashboards → JSON from any Grafana instance, when you have the auth correctly configured.

here’s the link to the dashboard script:

1 Like

Problem here is that API export has the format, which is accepted only by API import. download in GUI produces different format (it is similar, but not the same).

what’s the difference, and what would you like to do with the dashboards once you have a copy of them?