Editing and managing Grafana 9 alerts using JSON file

Hi. I’m trying to upgrade my Grafana 7.5 container to Grafana 9 including many dashboards and alerts linked to them.
I want to make some new panels in Grafana and import the old ones as well. In doing so, I want to be able to add alerts to my dashboard not by clicking buttons, but by editing the JSON file. The problem is in the previous versions of Grafana, alerts belonged to their respective dashboard and therefore they existed in the JSON file of the dashboard and could be manipulated at the code level, whereas in Grafana 9 the alerts are defined independently and I’m not able to find the JSON file they are defined in, because they are not in the dashboard JSON file anymore.
Where are they?
What’s the most efficient way to migrate these alerts? As exporting from the old dashboard and importing them into the new one doesn’t make the alerts to be defined in the new Grafana 9 alert system.

Environment:
Grafana Docker container

You don’t need to go the manual import of things

Why not just go the upgrade route?
If you want you can leave your current grafana as is, clone it to a new docker instance, change port, spin it up and upgrade this new clone maybe first to next version v8 then same clone upgrade to v9

Thanks for your reply.
I’m missing sth here. I have three volumes for my current grafana container: config, data, and log.
If I clone these and set my newly-built grafana 9 container to use these 3 as their volumes, everything will be migrated just fine? (supposing I have done these exact steps to upgrade to version 8 already.)
I mean all dashboards will exist there too and alerts are redefined automatically?

so

  1. you clone your current grafana so that it has it’s own own volume with config,data,log.
  2. upgrade this new clone first to v8
  3. upgrade this new clone from v8 to v9

Everything should exist in this new cloned and upgraded docker container

1 Like

@parsapahlavany

Also check this out on upgrade routes.

1 Like