Alerting: Improve Unified Alerting Rollback Warning (#50470) (#50472)

After migrating to unified alerting, users must explicitly allow rolling
back to legacy alerting by setting force_migration = true in config.
This updates the panic message to clarify why that's required and what
the consequences of rolling back will be.

Fixes #50469

(cherry picked from commit 30f035ca34)

Co-authored-by: Joe Blubaugh <joe.blubaugh@grafana.com>
This commit is contained in:
Grot (@grafanabot)
2022-06-09 07:48:59 +02:00
committed by GitHub
co-authored by Joe Blubaugh
parent 3fe8fec086
commit 4bb2ba53e8
@@ -75,7 +75,7 @@ func AddDashAlertMigration(mg *migrator.Migrator) {
case !mg.Cfg.UnifiedAlerting.IsEnabled() && migrationRun:
// Safeguard to prevent data loss when migrating from UA to LA
if !mg.Cfg.ForceMigration {
panic("New alert rules created while using unified alerting will be deleted, set force_migration=true in your grafana.ini and try again if this is okay.")
panic("Grafana has already been migrated to Unified Alerting.\nAny alert rules created while using Unified Alerting will be deleted by rolling back.\n\nSet force_migration=true in your grafana.ini and restart Grafana to roll back and delete Unified Alerting configuration data.")
}
// Remove the migration entry that creates unified alerting data. This is so when the feature
// flag is enabled in the future the migration "move dashboard alerts to unified alerting" will be run again.