Grafana fail to start if I manually edit grafana.db

  • What Grafana version and what operating system are you using?
    OS: Ubuntu 20.04.5
    Mysql: 8.0.32
    Grafana: 8.5.20

  • What are you trying to achieve?
    I’m trying to edit all dashboards at once. I just need to change a path which is present in a panel in all dashboards for another one.

  • How are you trying to achieve it?
    I stopped grafana-server, opened grafana.db with nano, replace the old path with the new one, close and save the file and then I restarted grafana. But when I check the status of the daemon I’ve found it failed to start. So, I go back to the previous version of grafana.db, restarted grafana-server and this time it could start correctly.

  • What did you expect to happen?
    I would like to edit all dashboards at once.

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

● grafana-server.service - Grafana instance
     Loaded: loaded (/lib/systemd/system/grafana-server.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sat 2023-02-11 16:03:11 -03; 9s ago
       Docs: http://docs.grafana.org
    Process: 66044 ExecStart=/usr/sbin/grafana-server --config=${CONF_FILE} --pidfile=${PID_FILE_DIR}/grafana-server.pid --packaging=deb cfg:default.paths.logs=${LOG_DIR} cfg:default.paths.data=${DATA_DIR} cfg:default.paths.plugins=${PL>
   Main PID: 66044 (code=exited, status=1/FAILURE)

Feb 11 16:03:11 serveraroo systemd[1]: grafana-server.service: Scheduled restart job, restart counter is at 5.
Feb 11 16:03:11 serveraroo systemd[1]: Stopped Grafana instance.
Feb 11 16:03:11 serveraroo systemd[1]: grafana-server.service: Start request repeated too quickly.
Feb 11 16:03:11 serveraroo systemd[1]: grafana-server.service: Failed with result 'exit-code'.
Feb 11 16:03:11 serveraroo systemd[1]: Failed to start Grafana instance.
Feb 11 16:03:17 serveraroo systemd[1]: grafana-server.service: Start request repeated too quickly.
Feb 11 16:03:17 serveraroo systemd[1]: grafana-server.service: Failed with result 'exit-code'.
Feb 11 16:03:17 serveraroo systemd[1]: Failed to start Grafana instance.

you edited it using a text editor? Might be better to use grafana api for this or a sqlite db editor instead?
how many dashboards are we talking about

Hi again yosiasz, yes I tried to use nano because I was able to find the text panels’ content, but it seems it is not a good idea. I’ve not tried to use the grafana api because I could not find an easy way to do it. I estimate it must be about 80 dashboards.

in that case you might want to use a proper sqllite db editor such as