Upgrading grafana from v6.5 to v9.5

Hello,
We have Grafana v6.5. We need to upgrade to v9.5.
We have lots of dashboards and influxdb,mysql,prometheus datasources.
Are there any risk for upgrading from 6.5 to 9.5.
Will our dashboards and datasource integrations be affected by this upgrade process?
How can we safely proceed with the process?

Welcome @ivbtar

Does your current grafana server use sqlite or another database flavor ?

Hello yosiasz,
I am not sure. I am new in this company.
How can i check that ?

Hello @yosiasz ,
Are you talking about sqlite database as a datastore ?
We have influxdb,mysql,prometheus datasources.

Grafana itself has its own db. You can check in the .ini file of the install folder

Hello @yosiasz ,

I checked garafana.ini
I think sqlite is not active.
You can find configuration below.

#################################### Database ####################################
[database]

You can configure the database connection by specifying type, host, name, user and password

as separate properties or as on string using the url properties.

Either “mysql”, “postgres” or “sqlite3”, it’s your choice

;type = sqlite3
;host = 127.0.0.1:3306
;name = grafana
;user = root

If the password contains # or ; you have to wrap it with triple quotes. Ex “”“#password;”“”

;password =

Use either URL or the previous fields to configure the database

Example: mysql://user:secret@host:port/database

;url =

For “postgres” only, either “disable”, “require” or “verify-full”

;ssl_mode = disable

For “sqlite3” only, path relative to data_path setting

;path = grafana.db

Max idle conn setting default is 2

;max_idle_conn = 2

Max conn setting default is 0 (mean not set)

;max_open_conn =

Connection Max Lifetime default is 14400 (means 14400 seconds or 4 hours)

;conn_max_lifetime = 14400

Set to true to log the sql calls and execution times.

log_queries =

Pretty much all the values are commented out so this might not be the actual ini used by your grafana server

Hello @yosiasz,
How can i make it clear?

Hello @yosiasz,

There was no database configuration in grafana.ini file.

But i learned that, if there is no db config in the ini file, grafana installs
default sqlite db by default in /var/lib/grafana/grafana.db

So i can say that our sqlite db exists in /var/lib/grafana/grafana.db
So what are your suggestions for the upgrade from v6.5 to v9.5

1 Like

where are your other key folders such as alerting,plugins etc? Are they all under /var/lib/grafana/

for starters you can try the following

  1. stop grafana service and backup grafana.db file and plugins folder
  2. start grafana service from #1
  3. install and start grafana v9.5 somewhere else on a test server
  4. check to see if new v9.5 works
  5. stop grafana v9.5
  6. copy grafana.db and plugins to their corresponding folders in v9.5
  7. Start grafaba v9.5, it should start migrating things.

Post back once you try this aggressive upgrade route from v6 to v9

Thanks alot @yosiasz,

Is it possible to upgrade on the current server on which we have v6.5 ?
We are planning to take a snapshot of current server.
Then we will create test server with snapshot.
We will try upgrade on that test server.
If upgrade is successfull.
We will throw away test server.
Then we will do same steps on current v6.5 live server.

1 Like

It is possible but you may need to stop developing any new dashboards

you can even try the blue green deployment approach.

on same server different folder, do upgrade then once you are happy you stop v6 and point to v9