Clear database and start over again, OH 3.4

Hello,
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,
Ingo

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.

Hi Ingo,

Yes, it’s possible to delete/clean the OH database and bring in the files afterwards. Here are the steps you can follow:

  1. Stop the openHAB service using the command: sudo systemctl stop openhab
  2. Delete the contents of the /var/lib/openhab directory using the command: sudo rm -rf /var/lib/openhab/*
  3. Start the openHAB service using the command: sudo systemctl start openhab
  4. After openHAB has started, copy your backup files into the appropriate configuration directories (/etc/openhab for configuration files, /var/lib/openhab for persistence files).
  5. Restart the openHAB service using the command: sudo systemctl restart openhab

I thank you both very much. I will try this soon.
Ingo