Hey,
I just wanted to upgrade our (dockerized) PMM instance from version 2.35 to the latest version.
This includes (according to the changelog) the migration from sqlite to postgres for the grafana datastore.
The changelog: PMM 2.37.0 - Percona Monitoring and Management does not state any manual steps required when performing the upgrade.
After the upgrade, grafana refused to start and logged the following error:
logger=sqlstore t=2023-06-07T11:12:19.583969017Z level=info msg=“Connecting to DB” dbtype=postgres
logger=migrator t=2023-06-07T11:12:19.589114973Z level=error msg=“alert migration failure: could not get migration log” error=“failed to check table existence: pq: role "grafana" does not exist”
I checked the postgres instance shipped with PMM and can confirm: There is neither a grafana user, nor a grafana schema.
How can/shall we migrate our grafana sqlite-file towards postgres?
EDIT: I found a comment in JIRA about manually migrating dashboards. I used pgloader to copy the data over from sqlite to postgres. Grafana was not happy about that:
logger=plugindashboards t=2023-06-07T12:53:27.849554117Z level=info msg=“Syncing plugin dashboards to DB” pluginId=pmm-app
logger=plugindashboards t=2023-06-07T12:53:27.850678326Z level=error msg=“Failed to load app dashboards” error=“pq: operator does not exist: bigint = boolean”
logger=infra.usagestats.collector t=2023-06-07T12:53:27.850709466Z level=info msg=“registering usage stat providers” usageStatsProvidersLen=2
logger=provisioning t=2023-06-07T12:53:27.869259165Z level=error msg=“Failed to provision data sources” error=“Datasource provisioning error: pq: invalid input syntax for type bigint: "false"”
Failed to start grafana. error: Datasource provisioning error: pq: invalid input syntax for type bigint: “false”
Datasource provisioning error: pq: invalid input syntax for type bigint: “false”
Could maybe be because I was not able to edit the mentioned “import-dashboards.py” file, because I have no idea, where this file lives.
Thanks a lot