Clear Items after updating OH2 via openhabian

Hi.
I have updated openhab2 via openhabian-config
deleted the addons folder and removed tmp and cache. After restarting old items are visible. especially an astro binding that doesn´t exist.
these items are visible in paper ui

Hoiw can i get rid of them?
deleting persistance?:

Why would you expect them to go away after an update?

because i haven´t installed the binding and the items file anymore. But they still remain

Ah, well an existing installation only knows to remove or edit Items defined from xxx.items files when it loads/reloads the files. You might try making empty file of same name.

Bindings installed or not have nothing to do with Items existing or not.

It’s going to be easier to do a fresh install if you are intent on destroying everything pre-existing.

The items in openhab paper ui are not from the existing .items files.
It´s a kind of bulk that doesn´t go away.
How can I delete all items?

Which brings us back to, why would you expect them to go away then?

Take care you are not fighting with OH2 “Simple Mode” auto-creating new Items for Things that it finds. Things are not going to go away by themselves either.

You’ll have to mess with the JSONDB. Stop openHAB first. Remember links are in a separate file.

It’s going to be easier to do a fresh install if you are intent on destroying everything pre-existing.

How can I do a fresh install using openhabian image? I have some other things installed (e.g. homebridge and iobroker) and don´t want to destroy the whole system.

Just to reiterate what rossko57 has said before answering myself:

  • Uninstalling a binding does not remove that binding’s Things nor any Items linked to the Channels of those Things.
  • Removing a Thing does not remove the Items linked to the Channels of that Thing.
  • The addons folder only contains those bindings installed from third party sources. Deleting it’s contents, assuming there was anything in it in the first place, will only uninstall those bindings that you’ve separately downloaded a jar file and placed there. It does not change binding installed any other way.
  • Clearing the cache and tmp will only force OH to reinstall the bindings previously installed. It does not uninstall bindings.
  • All Items defined in .items files will always be loaded and created. The only way to get rid of those items is to remove the .items file (same for rules, things, sitemaps, etc.).
  • All Items defined through the UI/REST API, including those created automatically through Simple Mode, exist in the JSONDB files. Those should be deleted through the UI/REST API.

There are a number of outstanding questions.

  • How did you install the binding?
  • How did you create these Items?
  • How do you know the binding is no longer installed?

If you just want to wipe out “everything” the instructions will depend on the answers to the above questions. But at a high level:

  • make sure all bindings are uninstalled; the process to uninstall the binding depends on how it was installed in the first place
  • delete all the files (but not the folders) under /etc/openhab2
  • delete all the files under /var/lib/openhab2/jsondb (you probably should keep the backups)
  • do the deletions with OH not running.

If you do want to just purge everything and start over from scratch I beleive:

sudo apt purge openhab2

will delete every trace of OH on the machine. Then reinstall it from openhabian-config.

1 Like

One of the most amazing answers! thank you so much for your advice!

It worked!

i did a “sudo apt purge openhab2” after a upgrade to openhab3 and i get

openhabian@openhab:~ $ sudo apt purge openhab2
[sudo] password for openhabian:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'openhab2' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.

but in openHAB-share folder i still get openhab2-addons,openhab2-conf,openhab2-logs,openhab2-sys,openhab2-userdata folders all empty .I deleted them manually but they show up again after reboot.
What i should do?Is this an indication that i have still openhab2 traces in my openhabian?

It has nothing to do with the openHAB package version itself.
It is indication that you did not use openhabian-config to migrate from v2 to v3, including the environment.

i used the openhabian-config option 03 to upgrade and the 42 for the enviroment…both times ended with an error msg like that


openhab2 folders gone empty,all my config files went to openhab folders,and frontail loginfo remain at openhab2 view.I reinstalled it through openhabian-config and now i have an openhab3 frontail.
despite that msg my system is working like normal openhab3