What are people doing to backup their Grafana dashboards? I’ve seen online people saying to use the grafana api to export the dashboard and save it off somewhere. Is that was everyone is doing or is there direct integration with Git?
Dear Michael,
we became aware of this fine piece of software just the other day. It might help you along.
With kind regards,
Andreas.
I have been using the repo that you is suggesting, and had to rebuild an installation with the backups from it. It is a good backup solution and you can easily add the backups into a git repository if you wanted to as well. The backup bash script could do the add, commit and push at backup completion so just one command need be run
Thanks for the link. I opened three new issues, one of them with a patch attached.
Kind regards,
Patrick
You could, alternatively, use Wizzy - retrieving dashboards, datasources and organizations as JSON files in order to version control is one of the use-cases.
Wizzy works great and is much better structured - thanks!
so the idea is to introduce yet another point of failure to remedy possible point of failure? There should be much easier way to backup/restore -e.g git commit/push from the dashboard location
https://github.com/ysde/grafana-backup-tool has been revamped by Aaron Johnson through https://github.com/ysde/grafana-backup-tool/pull/65 to work without any bashisms. Now, the program features a setup.py
to be installed as a Python-only package.
As it is now available on PyPI at https://pypi.org/project/grafana-backup/, installation should be as simple as
pip install grafana-backup
Hi again,
we are currently modernizing the grafana-import program by Pik Jean-Francois, and are also adding a few features, which we outlined on a community post on our workbench forum, mostly revolving around supporting “dashboard-as-code” workflows.
Release 0.3.0 is still pending, and may need a few more days to converge. However, the pip install
command demonstrated on that page should work already, pulling the most recent development version. Also, the link to the README file reflects the state of affairs of the most recent version.
So, depending on your spirits of how you are authoring Grafana Dashboards, this may spark your interest, and we will be happy to receive early feedback of any kind (kudos, critique, feature requests, bug reports, or anything else which comes to mind).
With kind regards,
Andreas.
NB: We are also looking into adding support for Grafana cog / Grafana Foundation SDK.
that would be a great feature to add I think or someone to develop a plugin for it
@grendel are you willing to add this feature to grafana or develop a plugin
Hi @yosiasz,
thanks a stack for your reply.
We think “dashboard-as-code” workflows will always be “external” to Grafana, because one of the main pillars here is to actually manage the representations of relevant artefacts using a Git repository. So, unless Grafana will receive a corresponding implementation to integrate with Git, in-core, or on behalf of a plugin, this would not be sensible for us.
Within the Prior Art section on the README, we also added Grafana Scenes to the enumeration, which is the closest and best variant to conduct “dashboard-as-code”, and also can’t be replaced by a plugin, because, well, it already is Grafana inside-out.
So, because we asked about any kinds of suggestions on this topic, and we mean it, we would like to extend our question how a corresponding plugin could look like, i.e. what you would be envisioning here. Thanks!
With kind regards,
Andreas.
there are a few ways to approach backups each with pros and cons. imo I would not recommend one over the other because it depends on the environment grafana is used in, the level of complexity of what you are visualizing (simple home grasshopper water feeder iot device vs landing a robot on the moon) and the backend used sqlite vs proper a simple spof mysql or postgres or HA type of setup, so the level of technical expertise of the grafana user etc, etc, etc. So key word is it depends
-
simple backup of the sqlite db file along with other folders pertinent to spinning your grafana back up or migration scenario
-
“dashboard as code” which you could implement using grafana api, with a scripting language such as python
or simply reading the backend. i put dashboard as code because again it depends how some implement it. -
a backup of the mysql or postgres db. many do this and ship it off to an offsite location or if sqlite is small enough git commit it?
etc etc… so many different ways. lots of this can be done via a plugin
or maybe even a site hosted under grafana that shows backup ui etc
Coming from a db background myself I personally lean on doing it via the db backup approach route in our environment
Hi. Just a quick update…
grafana-import 0.4.0 is now available on PyPI, enjoy.
If you have any ideas how to improve it, or discover any flaws while you are using it, please let us know through its issue tracker.