[QGIS-Developer] Rename QGIS plugin

Nils Nolde nilsnolde at gmail.com
Sat Feb 16 04:50:52 PST 2019


Hi Ervin,

I went through the same pain not too long ago. Unfortunately there's no 
graceful way to rename a plugin. I mean, no way to just change the name 
and the stats and history will preserve. You will have to create a new 
plugin basically and deprecate the old one. In my case it was purely 
semantic, functionality didn't really change. If functionality changes, 
I guess creating a new plugin would be the better way anyways.

The way I did it (or better will do it next week hopefully):
1. Upload the new plugin, stating it's the descendant of the old plugin
2. Release a last version of the old plugin, that will only:
     - install the new plugin from the repo
     - uninstall itself
     - don't forget to flag as deprecated!

I'm happy to tell you though, that QGIS makes this reeeeally easy. Have 
a look at my last version, it's literally 5 lines of code (just be sure 
to call unload() before you uninstall):
https://github.com/nilsnolde/orstools-qgis-plugin/blob/01f1c6b1a10c4fdf11c1076e1d1064eaff92b44b/OSMtools/OSMtoolsPlugin.py#L51

I can't remember who suggested this method, but it came from this list 
here too. Other suggestions were simple messages to install the new 
version or other simple user dialogs. Due to its simplicity, I went with 
the auto-uninstall.

Best of luck
Nils



More information about the QGIS-Developer mailing list