Migration Issues from 8 to 9

What happened?

There is no way to migrate Grafana 8.5.13 to any of Grafana 9 versions with Postgres backend.
It works if only the database is empty. If it contains data (dashboard, alerts, etc) after updating to grafana 9.0.x () it skipp all migrations. Running versions higher also skips migrations, but also fails to start with errors related to missed relations in the database (e.g. secrets, correlations, etc)

What did you expect to happen?

Update Grafana 8.5.13 to Grafana 9

Did this work before?

Don’t know

How do we reproduce it?

  1. Run Grafana 8.5.13 with Postgres backend
  2. Fill with data (dashboards, alerts, datasources, etc)
  3. Update to Grafana 9

Is the bug inside a dashboard panel?

No response

Environment (with versions)?

Grafana: 8.5.13
OS: docker image
Browser: Chrome

Grafana platform?

Kubernetes

Datasource(s)?

Prometheus, elasticsearch, cloudwatch

How are you doing this upgrade?

I’ve tried many options:

  1. Just run the next version of grafana from 9.0.0-9.5.14
  2. Dump data on 8.5.13 and restore in on Grafana 9 version
  3. Tried to create missed relation in Postgres

Nothing helps. Some options works better, but still has errors, other even refuse to run

1 Like

Try this

  1. Backup and restore/clone current db into a new database

2 spin up a fresh v9 grafana and copy over grafana.ini or default.ini from previous version to this new grafana and point it to new database you cloned

  1. Start new grafana

See how that goes

That was my very first attempt.

It doesn’t work. Grafana 9 skips migrations if database has data.

1 Like