Not able to add datasource: error="UNIQUE constraint failed: data_source.org_id, data_source.uid"`

Instead of deleting the whole grafana.db file, you can also open it with a tool like https://sqlitebrowser.org/. There, you can delete just the one UNIQUE constraint (on table data_source), then save the db file and restart Grafana. This worked for me (I also downgraded from Grafana 7 to 6.7.4 before the error occurred first).

1 Like