Dashboard schemaVersion HA migration issue

We recently upgraded from v4.1.1 to v5.4.3 (which runs DB migrations to update existing dashboards to the new positioning system, add a UID to the dashboards URL, and update all annotation timestamps)

Turns out there were still a couple instances still running v4.1.1 and using the v5.4.3 migrated DB dashboards. The migrated dashboards would obviously load in v4.1.1 since about 110 had some kind of updates - and were saved using v4.1.1

Now that we found the issue and upgraded the rogue v4.1.1 instances to v5.4.3 - those 110 dashboards will no longer load in v5.4.3. Looking at the dashboards json from /api/dashboards/db/

The dashboards have rows instead of panels
"schemaVersion": 14,
"uid": "",

The dashboards still show up in the Search, but the urls are broken as they are missing the uid

So the question is there a tool available to update the dashboards back to the new positioning system?
Or can I somehow manually rerun the DB migration again to update the dashboards?

I do not see a way to do either and I’ve been spinning my wheels on this all night.


btw - anyone that runs into a similar problem, just adding the UIDs to the dashboards that were saved with UI v4.1.1 while using DB from v5.4.3 was enough to get the dashboards to load from the UI again.

grafana=> CREATE TABLE dashboard_backup_20190327 AS TABLE dashboard;

grafana=> UPDATE dashboard SET uid=lpad('' || id,9,'0') WHERE uid IS NULL;