OH3 Broken links on items after upgrade from 2.5.10


i recently migrated my openhab 2.5.10 installation (.deb based on Ubuntu 20.x) to the current version 3.1.0. After some time i realised, that some items had broken channel links. Some had only one broken link, some had several broken links and one working link to the correct thing as well. This is an example of a IKEA Tradfri lamp:

Other examples are links to channels of enigma2 and LG things - they all looked like the things id changed by any means while upgrading…

I could recover this by removing the broken links and re-adding links to the correct thing/channel. My question is: Is there a way finding all items with broken links to channels without checking them step-by-step via the web interface? A script generating a list of item ids and names would be very helpful for finding all affected items.



From the Karaf console run

openhab:links orphan list

will show all the broken links and

openhab:links orphan purge

will delete them all.

1 Like

Hi Rich

Would you recommend running this as a maintenance step? I have not seen any issues with orphaned links on my system. But ran the openhab:links orphan list and was surprised to find a VERY long list.
Ran the purge as well with no ill effects that I can see.

Looking at the list of items etc these all appear to be as a result of changes due to my ongoing tweaking and learning.


An orphan link only happens when you are not as careful as you need to be when deleting Items and/or Things. You need to make sure that the Link gets deleted first or else it becomes orphaned.

It was really easy to create orphaned links in OH 2.x. It’s much less likely in OH 3 as most of the time MainUI will ask if you want to delete the Link too when deleting an Item or a Thing. But it’s a good idea to remove the Links first even there.

It doesn’t hurt to run it periodically. Orphaned Links are not necessarily a problem though so it’s no big deal if one doesn’t run it. It could cause problems if you intend to reuse that link later, for example by recreating an Item to change it’s name. Purging will mean the link needs to be recreated.

So I have no recommendation.

1 Like