I want to upgrade my grafana from v5.1 to v8.2 , though is a big jump so I want. to 1st move to some intermediate stable release then later on to latest release.
so could you please recommend some intermediate upgrade for major version jumping ?
You don’t mention which system you are running Grafana on, or how it was
installed (packaged or source, for example). I’m going to assume that:
a) it’s running on a machine which is either sufficiently up-to-date itself to
have all the library dependencies needed by Grafana 8.2, or can be upgraded to
have these during the process, and:
b) you’re using a package management system such as .deb or .rpm which will
deal with all the appropriate (versions of) dependencies for you.
I would advise:
Take a full backup of your system. Do not over-write it with any of the
other backups mentioned below.
Update to the latest release of version 5. Take an incremental backup (or
a full one if you have the space).
Read the release notes for version 6, and then upgrade to the latest
release of version 6. Take another backup.
Read the release notes for version 7, and then upgrade to the latest
release of version 7. Take another backup.
Read the release notes for version 8, and then upgrade to version 8.2.
It’s probably a very good idea at each stage to check your dashboards,
plugins, data sources etc to make sure everything’s still working as you are
used to, because some changes have broken backward compatibility, and some
changes mean that you should edit the names of dashboard panels etc. to use
new panel plugins in favour of deprecated ones.
As you say, it is a big jump, and unless you have quite a simple setup and are
somewhat lucky with the panels you are using, I don’t think you’ll be able to
do it in fewer steps than I’ve suggested.
For the plugins part, you can use the grafana-cli command line to update all at once OR one after another (maybe create a script which will only update the next one if the previous plugin did not throw an error)
[root@grafana ~]# grafana-cli plugins --help
NAME:
Grafana CLI plugins - Manage plugins for grafana
USAGE:
Grafana CLI plugins command [command options] [arguments...]
COMMANDS:
install install <plugin id> <plugin version (optional)>
list-remote list remote available plugins
list-versions list-versions <plugin id>
update, upgrade update <plugin id>
update-all, upgrade-all update all your installed plugins
ls list all installed plugins
uninstall, remove uninstall <plugin id>
help, h Shows a list of commands or help for one command
OPTIONS:
--help, -h show help (default: false)
That will update all your plugins at once. But as you are migrating from v 5.1 to v 8.2 I would say to update each plugin one after the other and see its effects in the UI because v 5.1 is a very old version and can expect that things might break up.
Sorry, I have one last question: what does the ‘update plugin’ means? I mean, under the hood, what was updated exactly?
(I think a plugin is a bundled frontend project, and it just update it’s connection to grafana itself ? )
Plugins are something you either download from the command line or via the UI. We have this page where many community-based and Grafana-maintained plugins are available:
So for e.g., I have the following list of installed plugins
[root@grafana ~]# grafana-cli plugins ls
installed plugins:
grafana-polystat-panel @ 1.2.11
simpod-json-datasource @ 0.6.0
yesoreyeram-boomtheme-panel @ 0.2.1
yesoreyeram-infinity-datasource @ 1.1.0
Please restart Grafana after installing plugins. Refer to Grafana documentation for instructions if necessary.
As you can see that next to the plugin name is the version number.
Now, I want to update the polysat panel plugin, I would run the command:
[root@grafana ~]# grafana-cli plugins update grafana-polystat-panel
Removing plugin: grafana-polystat-panel
✔ Downloaded and extracted grafana-polystat-panel v2.0.4 zip successfully to /var/lib/grafana/plugins/grafana-polystat-panel
Please restart Grafana after installing plugins. Refer to Grafana documentation for instructions if necessary.
Notice the new version is 2.0.4 (older was 1.2.11)
OK, thanks! It means grafana-cli plugins update xxx-plugins will update the specific plugin by download its latest version, but what happens if I build this xxx-plugin myself?(and run grafana-cli plugins update xxx-plugins for it, nothing will happen or some other logic here?)
And one more question: if we installed a plugin with grafana UI, where did grafana reserve these info of the plugin? (version and plugin.id, name, etc…) After that, when grafana restarts, it will find out which plugins need to be installed and download it to ./data/plugins directory? If it is a plug-in packaged with local code, is it directly copied into this folder?