Import JSON Panels

The error occurred when importing JSON panels from the previous organization, with the message 'Failed to upgrade legacy queries: Datasource was not found
“Hope someone can help me with this. Thanks.”

welcome @juradomarcio41

Are you upgrading to a new grafana version and moving all of your dashboards over or just moving one dashboard?

Also what is the backend you are using for grafana? sqlite or something else?

Hello @yosiasz

Thanks for your help

I’m just moving the Dash.

About the back-end information, I’m not sure, but it must be Postgresql

is the datasource created in the second org you are moving to?

Yes it was created

now compare at the datasource uid because those might differ from one org to another

      "datasource": {
        "type": "mssql",
        "uid": "4HrrzTv4z"

your dashboard needs to have the proper uid even though the type might be the same from source dashboard

Ok @yosiasz , I will validate this information.

Thanks for your help.

1 Like

Hello @yosiasz


Do UIDs need to be the same between organizations?

Uids are uids they will never be the same, well you could make them the same but will defeat purpose of uids

Find the datasource uid of the 2nd org datasource and set the import json dashboard"s datasource uid to it

Hi @yosiasz Can you explain how to do the above? I just set up a new Grafana instance (v. 10.2.3) and configured with the same InfluxDB datasource and confirmed it connects fine.

I then imported the JSON of a panel from another Grafana instance (v. 9.2.0) and got this:

hey @grant2

What is the uid of the InfluxDB data source in the new instance? You can check in the backend of the grafana: sqlite or mysql or …

Got it! Just grabbed the new uid from an export of a newly created (from scratch) dashboard…


then opened the JSON file that I wished to import and did a Find (the old uid) & Replace (with the new one shown above). Newly imported panel renders perfectly.