Section panel[] is getting empty after moving dashboard by API

Have I missed something in parameters for used api method?

Here is a screenshot of an initial dashboard

The screenshot of the same dashboard after the moving command

Next commands were used

curl -k --silent -X POST -H “Content-Type: application/json” -d ‘{“title”:“Folder 1”}’ http://admin:admin@18.218.76.94/graph/api/folders | python -m json.tool{
“canAdmin”: true,
“canEdit”: true,
“canSave”: true,
“created”: “2018-04-13T08:26:13Z”,
“createdBy”: “admin”,
“hasAcl”: false,
“id”: 40,
“title”: “Folder 1”,
“uid”: “xhfklkWik”,
“updated”: “2018-04-13T08:26:13Z”,
“updatedBy”: “admin”,
“url”: “/graph/dashboards/f/xhfklkWik/folder-1”,
“version”: 1
}

silvo@linux-adivinho:~/Desktop> cat dash-cut.json
{
“dashboard”: {
“id”: 41,
“title”: “dashboard 1”,
“uid”: “JZFn_zWmz”,
“version”: 2
},
“folderId”: 40,
“overwrite”: false
}

curl -k --silent -X POST -H “Content-Type: application/json” -d @dash-cut.json http://admin:admin@18.218.76.94/graph/api/dashboards/db | python -m json.tool
{
“id”: 41,
“slug”: “dashboard-1”,
“status”: “success”,
“uid”: “JZFn_zWmz”,
“url”: “/graph/d/JZFn_zWmz/dashboard-1”,
“version”: 3
}

Hi,

Is there any update about this issue?
I have had a worst case, almost all of my dashboard component disappear (annotations, panels, tags,…) and the json file size pass from 15Kb -> 1Kb…

I’m using Grafana v5.3.2

Thanks,

Hey,

I manged to move dashboards by next commands. It was processed on Grafana 5.4.2

— get dashboard —

curl -k --silent -H “Authorization: Bearer eyJrIjoidkk0RXNWM2xSdXBOdEFpUVM1dnpNNE16aTJGU0NKV3EiLCJuIjoiYW1kaW4iLCJpZCI6MX0=” http://x.x.x.x/graph/api/dashboards/uid/1oz9QMHmk | python -m json.tool > dd.json

— modified result file -> add at the end of file dd.json —
,
“folderId”: 2,
“overwrite”: true

— moved dashboard —

curl -k --silent -X POST -H “Content-Type: application/json” -H “Authorization: Bearer eyJrIjoidkk0RXNWM2xSdXBOdEFpUVM1dnpNNE16aTJGU0NKV3EiLCJuIjoiYW1kaW4iLCJpZCI6MX0=” -d @dd.json http://x.x.x.x/graph/api/dashboards/db | python -m json.tool
{
“id”: 21,
“slug”: “advanced-data-exploration”,
“status”: “success”,
“uid”: “1oz9QMHmk”,
“url”: “/graph/d/1oz9QMHmk/advanced-data-exploration”,
“version”: 6
}

1 Like

Need to be added just before the last brace!
Thank you Adivinho!