Renaming datasources with renaming in dashboards and panels

I’m going to need to rename some of the datasources in my various orgs - to make them unique prior to converting from Orgs to Teams in Grafana.

Am I correct in thinking that the only way to do this is to check the JSON in every single panel and make updates as needed - ie there’s no rename-datasource API endpoint that would handle the dashboard updating bit?

Obviously I don’t want to go coding my own tooling if there’s something out there already!

I think you can do it with the Grafana APIs.

You can update a data source:

And you can update dashboards:

Thanks @dianapayton - but the key point was to have something that would automatically update any dashboard that relied on the renamed datasource. I’m guessing that I’ll have to link the various API’s with glue code, and have to scan all the dashboards.