Porting alerts from one Grafana instance to another

How can I get alerts (configured UI) from one grafana instance to another? I’ve been doing that with dashboards by copying JSON around - is something similar available for grafana 8 alerts?

No, there really isn’t. We’re still deciding what/when/how/if for provisioning/alerts as code.

On the up side, the HTTP API is a good potential solution for this. The hardest part of copying rules would be that the datasource UIDs will not be consistent from one instance of grafana to the next (unless there’s something I don’t get about how those UIDs are set but I’m reasonably certain that’s the case)

You would also have to consider dashboard UIDs and panel IDs if you wanted your alerting rules to be linked automatically to a dashboard for things like the alert list plugin and annotations

Yes to both the above answers from . The way we went about solving this use-case is jq-fu.

Query the source Grafana APIs to export out the UUID for Folders, Datasources, Dashboards and then Alerts. Once you have the Object UUIDs, export each and every object in full. Then import them all to the destination Grafana Server.

One would need Admin API token in both Source and Destination Grafana Servers to achieve this.

Hope this helps, ?

Is this specific to grafana 8 alerts? or is it the same deal with Legacy alerts?

At my current level of grafana maturity, this is a huge vote for “delete the test and staging grafana instances, and just have three Prometheus data sources feeding into one grafana”

We are on Grafana v7.2.1 currently, but the migration technique has remained unchanged between the prior major version(s) also.