Renaming Items and Groups, and updating persisted InfluxDB 1.x measurements accordingly

Thanks for posting. This is a more detailed set of instructions compared to what I posted in OH 3 Tips and Tricks. I’ve a few elaborations to add for those who might not have the exact same setup as you.

Actually, all configurations made through the Karaf Console, the REST API, or the UI since OH 2.0 has been stored in JSON format in the JSONDB (except really early on when MapDB was used before JSONDB was adopted prior to the release of OH 2.0. This isn’t new in OH 3.

This is the location on any Linux where OH is installed via apt or yum or whatever. On most other platforms or ways to install OH (e.g. Docker, Windows, Mac, etc.) the path will be $OH_HOME/userdata/jsondb where $OH_HOME is the root folder where openHAB resides.

If OH isn’t installed you may have to use the full path unless you’ve manually created environment variables.

To avoid confusion I’d reword this to “Switch to the openhab user”. This really isn’t logging in and in fact you cannot log in as the openhab user at all. That’s part of the security behind running services as a separate user.

I like the use of sed for this. In my instructions I had the user open the files in VSCode and use find and replace. However, one advantage of using find and replace is that you can manually verify each and every change which might be a tad safer if the original grep returned more than just lines with oldName. But it’s also a whole lot more work.

Don’t forget the .persist files. In some cases users might have listed individual Items there. The same for .sitemap files. I think that covers everywhere an Item will appear directly be name.

The last thing I’d recommend is repeat all the steps one Item at a time and test that it works before continuing. That way if your luck doesn’t hold out you don’t have to redo everything again, just the most recent Item.

I general, manually editing the JSONDB is a risky thing to do and should only be considered when no other way is possible.