Dear Grafanistas,
I am writing in the hope of hearing from you some short cuts in solving this problem. (Rather than the usual heuristics cycles )
Scenario,
Due to a data loss incident, there is no current grafana.{ini,db}
In fact the only up to date assets are the full set of json for the dashboard.
This includes the library panels
In case you are wondering how come this json data is available?
Well, we salvaged it from a browser window that had the dashboard open at the time of the data loss. so far I have opnly tried to salvage the main dashboard json and the library panel json.
This has not proven to be a problem.
We want to take the dashboard and its associated library panels and folders from a system and importing them into a virgin system which has not users,folders or other assets defined. We know the folder name
for the library panels.
The dashboard json salvaged references a libraryPanel
ln this fashion:
"id": 421,
"libraryPanel": {
"name": "My Panel Name",
"uid": "abb2a1df-fed0-4ef9-9037-e56d8f9fb8ff"
For example here is data from a random libraryPanel
from salvaged json
"id": 443, "libraryPanel": {
"id": 24,
"orgId": 207,
"folderId": 396,
"folderUid": "a26e59e0-a1b4-4b5b-9d80-e214de159d5b",
"uid": "edl3yqlbp8kqob",
"name": "some name",
"kind": 1,
"type": "gauge",
"description": "",
"model": {
and more:
"version": 1,
"meta": {
"folderName": "My Folder ",
"folderUid": "a26e59e0-a1b4-4b5b-9d80-e214de159d5b",
"connectedDashboards": 1,
"created": "2022-05-08T17:46:14Z",
"updated": "2022-05-08T17:46:14Z",
"createdBy": {
"avatarUrl": "/avatar/b1e2683efeb1c1f6f116b0d3c0ace29c",
"id": 1,
"name": "admin"
},
In summary, we are without a grafana.db and in a virgin system and have the json files defining the dashboard and the library panels that it references.
FWIW, the folder and user information from grafana.db is not available in this new system.
Obvious idea is to rename the id and uid and uuid where required so that they correspond.
This for the folder and library panel referencing.
What is the best way to recreate the library panels? I guess extract from the library panel the data for an actual native panel.
Then create library
anel from that so created native panel?
A first trivial importing of the dashboard json expectedly delivers errors.
Templating
Failed to upgrade legacy queries
For the library panels, the following errors:
Panel plugin not found:
Is an elegant approach to fix this problem of recreating the dashboard?
Many thanks for any pointers
E