All items are gone

  • Platform information: openhab docker 2.3.0
    • Hardware: ryzen server
    • OS: manjaro
    • Java Runtime Environment: openjdk version “1.8.0_192”
    • openHAB version: 2.3.0 docker
  • Issue of the topic: all items added with paper ui are gone!

Hello,

I´m using openhab since a while and it was working fine. I added all my items by paper ui.
I ran serveral updates since I added everythin. Always fine.
But now after last docker update everything is deleted. The sitemap which I have created manually is still there.

Can I somehow restore the deleted items?

Gruß,
Stefan

Do you have backups?

If I am not mistaken most of the info if added through Paper UI is in your json database. You should be able to restore this and see them again.

If you have no backup they will most likely need to be added again in paper ui

Last you could try clearing cache sometimes this fixes issues.

There’s many potential reasons but you don’t give enough info to determine what has happened.
One possible reason is that you screwed up your jsondb file /var/lib/openhab2/jsondb/org.eclipse.smarthome.core.thing.Thing.json. In that case you may be lucky as it’s keeping backup copies by default (see backup directory). Shutdown OH before you copy it back.

Ok, thanks about the hints.
In my openhab directory I have found a directory named backup which contains one backup from June this year. In my openhab config in paper ui I have defined to keep 5 backups (default) of the json database.
Where are these files stored?

Best regards,
Stefan

So all items which are created (manually/automatically) will be serialized into this json file?
Easy to backup then :slight_smile:

If created via PaperUI, yes.

Right in that backup directory. As yours are missing (there should be some assuming you do have made changes since June), there’s something fundamentally wrong with your setup.
Probably because of the Docker setup. I’d move to a non-Docker install, there’s little benefit in Docker in Home Automation anyway.

So created manually via ~/things directory won’t serialize the items?
Not relevant for backing up, (thus of the fact that you can just backup the directory) but doesn’t make sense to me.

Don’t know what you mean by ‘serialize’ but no AFAIK those things and items taken from source files won’t be copied into jsondb.

Backup is another story. You definitely should not backup files or directories yourself but use openhab-cli backup plus (if on openHABian) Amanda instead.

It’s called serializing to convert items into a JSON string to my knowledge.

Yeah I know, but didn’t had time to look into that. but Thanks for pointing out!

I’m having the same issue lately after the last update.
Takes some time now to reconfigure.
The Json file doesn’t provide any Information.
Is there another way to restore?

This is absolutely correct. Only Things and Items created automatically or through one of the UIs go to the JSONDB.

Anything defined in the conf folder doesn’t get saved to the JASONDB.

Actually it is called serializing to convert Objects to some string to save to a file. I’m not entirely certain that the term is appropriate when talking about OH Things and Items. It probably does make sense but this is the first use I’ve seen of serializing in this context.

Anyway, the fact that all your Items are gone is of concern. Is it just Items or Things that are disappearing?

What steps in detail do you take when they disappear?

Are you mounting the userdata folder into your container?

To restore the JSONDB file, stop OH and copy the most recent file in $USERDATA/jsondb/backups to $USERDATA/jsondb and restart OH.