I have OH 3.4 running on Pi4 (openhabian).
Since some time I get stange errors and even by using older backups the errors come back as soon as I change something on the THINGS files, ITEM files or others.
Since all my config is done via files (at least I hope so), I want to try to delete / clean the OH Database and bring in the files afterwards. Is this possible and how?
Thanks in advance,
Simplest solution would be to move all text files to another folder, then purge openhab and reinstall from scratch. After first login, copy files back. In fact, Things and Items from text files should not be stored in the jsondb files at all.
Yes, it’s possible to delete/clean the OH database and bring in the files afterwards. Here are the steps you can follow:
- Stop the openHAB service using the command:
sudo systemctl stop openhab
- Delete the contents of the
/var/lib/openhabdirectory using the command:
sudo rm -rf /var/lib/openhab/*
- Start the openHAB service using the command:
sudo systemctl start openhab
- After openHAB has started, copy your backup files into the appropriate configuration directories (/etc/openhab for configuration files, /var/lib/openhab for persistence files).
- Restart the openHAB service using the command:
sudo systemctl restart openhab
I thank you both very much. I will try this soon.