Bash one liner: Fix Grafana SqLite

By | May 19, 2025

At times when closing Grafana with a kill command SqLite can get corrupted.

This is the one liner that saves the day:

# echo ".dump" | sqlite3 grafana.db | sqlite3 grafana_new.db

This will load, clean, validate and then dump the db file in a new db file. 

Then simply copy the new grafana_new.db as the new grafana.db and restart Grafana.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.