Bulk Grafana Dashboard Export

I’m trying to perform a bulk download of multiple dashboards from an open source version of Grafana, but cannot find a way to download all dashboards while preserving the current folder structure. I can see the “Share” open when accessing an individual dashboard from within a given folder, but is there a way to export all dashboards across all folders into a single JSON? Below is an example of what the current folder structure looks like, each of which contain two or three embedded dashboards each.

If anybody has any insights on how this may be possible, it would be most helpful!

What is the aim of this download?

@yosiasz - The intent is to be able to re-create the same dashboards and folder structure on another machine with the same operating system/version of Grafana. I’m trying to retrieve all of the dashboards in a single file (if possible), so that I can import the file (e.g. JSON) in another Grafana environment without having to create all the dashboard panels one by one. Please let me know if this is possible, thanks again!

1 Like

What is the backend of your grafana setup? sqlite or some other db

@yosiasz - The dashboard is populated using a MySQL data source, but that is the primary component on the backend.

One approach is to backup MySQL grafana database and restore it

Another is using grafana API to export dashboards and datasources etc

I prefer #1

@yosiasz - I came across that documentation on MySQL back-up/restore, but I more so need to export the dashboards and preserving the folder structure to re-create the configuration on another machine with Grafana. The second option may be more sufficient, but is there a plugin/feature using the Grafana API to support the bulk dashboard exports? Thanks again for your help!

The dashboard and folder stuff is saved in db

Why not try it in a test environment?

Otherwise no such plugin exists to do that you would have to use some scripting language like python