Uploading grafana Teams, team ID not preserved #334
Replies: 2 comments
-
This is a bug/limitation right now. I don't think you're doing anything wrong. The teams right now are being deleted and re-created. Let me see if I manage to update that code to do an update instead. I think if the UIDs are preserved you should be able to use the permissions you've downloaded to persist the data. The only issue with this pattern is that all of these UIDs are going to be unique to the instance, so moving from one environment to the next might be a bit troublesome. I'd like try to support patterns where we create something entities in say staging and moving to production. That's a primary usecase we use internally. I'm going to make an issue for this and see if I can make some progress on this. Reference: #385 |
Beta Was this translation helpful? Give feedback.
-
This is a bug/limitation right now. I don't think you're doing anything wrong. The teams right now are being deleted and re-created. Let me see if I manage to update that code to do an update instead. I think if the UIDs are preserved you should be able to use the permissions you've downloaded to persist the data. The only issue with this pattern is that all of these UIDs are going to be unique to the instance, so moving from one environment to the next might be a bit troublesome. I'd like try to support patterns where we create something entities in say staging and moving to production. That's a primary usecase we use internally. I'm going to make an issue for this and see if I can make some progress on this. |
Beta Was this translation helpful? Give feedback.
-
GDG version: 0.7.1
command executed: /app/gdg backup team upload
Running on docker
Local storage
I am encountering a challenge when uploading teams and folder permissions to Grafana. Specifically, the issue arises from how gdg upload the team IDs. Although the folder-permission JSON explicitly links permissions to predefined team IDs, Grafana appears to assign teams IDs based on alphabetical order when uploading the teams.
As a result, the mismatched team IDs lead to incorrect folder permissions being assigned, causing a disruption in the intended configurations.
Example.
Team Json
{
"avatarUrl": "/avatar/e115e1397cec31ece81567f33b2aa0b6",
"id": 5,
"memberCount": 1,
"name": "telcoExplorer",
"orgId": 1
}
Folder permission Json
{
"created": "2025-01-08T06:15:43.000Z",
"folderId": 3,
"isFolder": true,
"permission": 1,
"permissionName": "View",
"slug": "aom-uam",
"team": "telcoExplorer",
"teamAvatarUrl": "/avatar/e115e1397cec31ece81567f33b2aa0b6",
"teamId": 5,
"title": "AOM_UAM",
"uid": "yMIyqExVk",
"updated": "2025-01-08T06:15:43.000Z",
"url": "/dashboards/f/yMIyqExVk/aom-uam"
},
For reference:
In the JSON team, team IDs are clearly defined and related to folder permissions. 5 and 5,
Upon upload, the IDs are reassigned alphabetically, creating the mismatch. creating the telcoexplorer id = 7
/app/gdg backup team upload
I would appreciate any guidance on how to resolve this issue. Is there a way to ensure that the team IDs in Grafana align with the predefined IDs in the teams JSON? maybe the /app/gdg backup team upload --team solve this, i dont know how to use it? , or i am missing something?
Thank you for your time and assistance. I look forward to hearing from you.
Beta Was this translation helpful? Give feedback.
All reactions