{"id":15481855,"url":"https://github.com/grafana-tools/grafana-backup","last_synced_at":"2025-10-24T01:27:23.635Z","repository":{"id":57543077,"uuid":"74074858","full_name":"grafana-tools/grafana-backup","owner":"grafana-tools","description":"[ON HOLD] CLI tool for backup/restore Grafana dashboards and datasources.","archived":false,"fork":false,"pushed_at":"2017-12-14T17:59:14.000Z","size":61,"stargazers_count":28,"open_issues_count":7,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-17T07:16:48.398Z","etag":null,"topics":["backup","cli","grafana","http","tools"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grafana-tools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-17T22:57:45.000Z","updated_at":"2022-06-22T08:56:56.000Z","dependencies_parsed_at":"2022-09-26T18:31:28.761Z","dependency_job_id":null,"html_url":"https://github.com/grafana-tools/grafana-backup","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana-tools%2Fgrafana-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana-tools%2Fgrafana-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana-tools%2Fgrafana-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana-tools%2Fgrafana-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grafana-tools","download_url":"https://codeload.github.com/grafana-tools/grafana-backup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250276208,"owners_count":21403817,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backup","cli","grafana","http","tools"],"created_at":"2024-10-02T05:06:37.782Z","updated_at":"2025-10-24T01:27:18.592Z","avatar_url":"https://github.com/grafana-tools.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Backup tool for Gafana\n\nCLI for the simple backup/restore operations of [Grafana](https://grafana.com/) dashboards and datasources.\nIt uses [Grafana client SDK](https://github.com/grafana-tools/sdk).\n\n**Work in progress. Current state: it may works, may not. Depends on build. Don't use it yet!**\n\n## Examples\n\nBack up all dashboards and any datasources which they require. Backups will be saved as separate files in \nthe directory $CWD/backup\n\n```$ grafana-backup -url http://127.1:3000 -key xxxxxxxx backup```\n\nShow all dashboards which have the flags \"tagone\" and \"tagtwo\" applied and any datasources they use.\n\n```\n$ grafana-backup -tag tagone,tagtwo ls\n\u003c31\u003e \"Test Dashboard 1\" [tagone tagtwo] \n\u003c10\u003e \"prometheus-test\" (prometheus) http://prometheus-test.example.com:9090\n\u003c8\u003e \"Promt2Local\" (prometheus) http://prometheus-poc.example.com:9090\n```\n\nShow the dashboard titled \"Test Dashboard 3\" and the datasources it uses.\n\n```\n$ grafana-backup -title 'Test Dashboard 3' ls\n\u003c33\u003e \"Test Dashboard 3\" [] \n\u003c10\u003e \"prometheus-test\" (prometheus) http://prometheus-test.example.com:9090\n\u003c8\u003e \"Promt2Local\" (prometheus) http://prometheus-poc.example.com:9090\n```\n\nBack up all dashboards which have the flags \"tag1\" and \"tag2\" applied and any datasources they use.\n\n```\n$ grafana-backup -url http://127.1:3000 -key xxxxxxxx -tag tag1,tag2 backup\n```\n\t\t\nBack up a dashboard called \"sample\"\n\n```\n$ grafana-backup -url http://127.1:3000 -key xxxxxxxx -tag tag1,tag2 -title sample backup\n```\n\t\nBack up all dashboards, datasources and users\n\n```\n$ grafana-backup -url http://127.1:3000 -key xxxxxxxx -apply-for all\n```\n\nShow information about local backup files\n\n```\n$ grafana-backup ls-files\ntest-dashboard-1.db.json:\t board id:31 \"Test Dashboard 1\" [tagone tagtwo]\ntest-dashboard-2.db.json:\t board id:32 \"Test Dashboard 2\"\ntest-dashboard-3.db.json:\t board id:33 \"Test Dashboard 3\"\n\n``` \n\nRestore all local objects which have the tag \"tag1\" applied to them. \n\n```\n$ grafana-backup -url http://127.1:3000 -key xxxxxxxx -tag tag1 restore\n```\n\nView the usage\n\n```\n$ grafana-backup \nBackup tool for Grafana.\nCopyright (C) 2016-2017  Alexander I.Grafov \u003csiberian@laika.name\u003e\n\nThis program comes with ABSOLUTELY NO WARRANTY.\nThis is free software, and you are welcome to redistribute it\nunder conditions of GNU GPL license v3.\n\nUsage: $ grafana-backup [flags] \u003ccommand\u003e\n\nAvailable commands are: backup, restore, ls, ls-files, info, config, help.\nCall 'grafana-backup help \u003ccommand\u003e' for details about the command.\n\n  -apply-for string\n    \tapply operation only for some kind of objects, available values are \"auto\", \"all\", \"dashboards\", \"datasources\", \"users\" (default \"auto\")\n  -dir string\n    \tA directory to write backup files to or read them from. (default \"backup\")\n  -force\n    \tforce overwrite of existing objects\n  -key string\n    \tAPI key of Grafana server\n  -starred\n    \tonly match starred dashboards\n  -tag string\n    \tdashboard should match all these tags\n  -timeout duration\n    \tread flagTimeout for interacting with Grafana in seconds (default 6m0s)\n  -title string\n    \tdashboard title should match name\n  -url string\n    \tURL of Grafana server\n  -verbose\n    \tverbose output\n```\n    \n        \n## List of proposed commands, flags and args\n\nDraft and it is subject for changes.\n\n\t# List dashboards.\n\t$ grafana-backup -key=xxxx -url=x.y.z -title=match-name -tag=x,y,z ls\n\n\t# List datasources.\n\t$ grafana-backup -key=xxxx -url=x.y.z ls-ds\n\n\t# List users.\n\t$ grafana-backup -key=xxxx -url=x.y.z ls-users\n\n\t# Do backup for matching dashboards.\n\t$ grafana-backup -key=xxxx -url=x.y.z -title=match-name -tag=x,y,z backup path/to\n\n\t# Restore objects on a server at url only for boards match tags.\n\t$ grafana-backup -key=xxxx -url=x.y.z -tag x,y,z restore path/from\n\n\t# List local backups for tags and file mask\n\t$ grafana-backup -tag x,y,z -file \"backup/*/*\" ls-files \n\n\t# Save all flags to config var.\n\t$ grafana-backup -key=xxxx -url=x.y.z config-set confname\n\n\t# Get flag values for config variable.\n\t$ grafana-backup config-get confname\n\n\t# Flag applied for backup/restore\n\t-objects=auto,dashboards,datasources,users,all\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrafana-tools%2Fgrafana-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrafana-tools%2Fgrafana-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrafana-tools%2Fgrafana-backup/lists"}