# Clearing cache results on loss of admin user and sitemap

**URL:** <https://community.openhab.org/t/clearing-cache-results-on-loss-of-admin-user-and-sitemap/167298>\
**Category:** Migration\
**Tags:** openhab5\
**Created:** [November 23, 2025, 11:04am UTC](https://community.openhab.org/t/clearing-cache-results-on-loss-of-admin-user-and-sitemap/167298 "2025-11-23T11:04:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![xr37](https://community.openhab.org/letter_avatar_proxy/v4/letter/x/e56c9b/32.png) [@xr37](https://community.openhab.org/u/xr37)\
**Post date:** [November 23, 2025, 11:04am UTC](https://community.openhab.org/t/clearing-cache-results-on-loss-of-admin-user-and-sitemap/167298/1 "2025-11-23T11:04:49Z")

</div>

After migrating from OpenHAB 4.3.x to 5.0.2 (OpenSUSE Leap 15.5), if I stop the OpenHAB service (`systemctl stop openhab`) and then run `openhab-cli clean-cache` (as root) or manually remove the files via `rm -rf /var/lib/openhab/cache /var/lib/openhab/tmp`, on restart (`systemctl start openhab`) I experience this:

- On navigating via a web browser to `http://openhab:8080/` it will ask me to create an admin account (see [attachment](https://community.openhab.org/uploads/short-url/7I7TBdFaxINNFH2fKyTpC6XeGYV.png))
- The Android client reports that no sitemaps can be found (and this is confirmed via the web browser, once creating a new admin account and logging in)
- Other settings (Things, model, …) seem to be preserved.

Any ideas?

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [November 23, 2025, 11:45pm UTC](https://community.openhab.org/t/clearing-cache-results-on-loss-of-admin-user-and-sitemap/167298/2 "2025-11-23T23:45:14Z")

</div>

I’ve no ideas because OH stores the user accounts in `/var/lib/openhab/jsondb/users.json`. It’s not stored in cache nor tmp.

Sitemaps are stored either in `/etc/openhab/sitemaps` if manually created or in `/var/lib/openhab/jsondb/uicomponents_system_sitemap.json`.

These files exist alongside where Things and Items are stored and the jsondb file is untouched by clearing the cache. Something else must be going on. Do you have any strange mount points, symbolic links, non-standard installation configurations, etc?

---

<div class="post-metadata">

**Author:** ![xr37](https://community.openhab.org/letter_avatar_proxy/v4/letter/x/e56c9b/32.png) [@xr37](https://community.openhab.org/u/xr37)\
**Post date:** [November 24, 2025, 11:04am UTC](https://community.openhab.org/t/clearing-cache-results-on-loss-of-admin-user-and-sitemap/167298/3 "2025-11-24T11:04:59Z")

</div>

> [@rlkoshak](#):
>
> I’ve no ideas because OH stores the user accounts in `/var/lib/openhab/jsondb/users.json`. It’s not stored in cache nor tmp.

Indeed. And `users.json` was were it was expected to be and appeared to have the correct details, as far as I could tell.

> [@rlkoshak](#):
>
> Sitemaps are stored either in `/etc/openhab/sitemaps` if manually created or in `/var/lib/openhab/jsondb/uicomponents_system_sitemap.json`.

Same here. The relevant file is there, just it doesn’t get picked up.

If I re-create the admin user, most of the other configuration is still there. The UI will ask me to go through the set-up process (provide timezone, location, etc.) but the data is already there so whether one follows or skips the set up dialogues does not seem to make any difference. The one piece of data that is not picked up by the system is the sitemap (of which I only have one) even though, as you say, the relevant file is there and seems correct.

I ended up restoring the 4.3.7 backup onto another computer and then copied the site map definition from the UI (code tab) and pasted onto the new install, which works fine.

There were also other errors, such as many console commands (e.g., `log:tail`, `log:set`) not being available. I managed to solve those with some AI help, which involved a selective, manual restore and use of `/usr/share/openhab/runtime/bin/upgradetool.jar`.

Sorry I can’t offer any useful cues. I’m not familiar with OpenHAB’s internal architecture and hadn’t come across anything like this before. Just sharing in the hope that someone else has seen, or will see in the future, something similar.

---

<div class="post-metadata">

**Author:** ![xr37](https://community.openhab.org/letter_avatar_proxy/v4/letter/x/e56c9b/32.png) [@xr37](https://community.openhab.org/u/xr37)\
**Post date:** [November 24, 2025, 11:13am UTC](https://community.openhab.org/t/clearing-cache-results-on-loss-of-admin-user-and-sitemap/167298/4 "2025-11-24T11:13:17Z")

</div>

Just to add: should anybody feel like trying clearing the cache on their system in an attempt at reproducing the issue, I would strongly suggest to take a **full** backup first:

```bash
systemctl stop openhab &&
openhab-cli backup --full "openhab-$(date -u +%Y%m%d%H%M%S).zip" &&
openhab-cli clean-cache;

systemctl start openhab

```

In my case, restoring the full backup has brought back full functionality after the breakage caused by clearing the cache.

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [November 24, 2025, 2:36pm UTC](https://community.openhab.org/t/clearing-cache-results-on-loss-of-admin-user-and-sitemap/167298/5 "2025-11-24T14:36:38Z")

</div>

> [@xr37](#):
>
> hadn’t come across anything like this before

As far as I know no one else has either.

Did you try to just restore your config from 4.3 over to a new 5.0 install instead of doing an in place upgrade? A bunch of steps get skipped when you try to do that and indeed you must run the upgradeTool manually in that case. But even if that were the case, a cache clearing shouldn’t cause these problems.

Note, clearing the cache is part of the upgrade process. You cannot upgrade to a new version of OH without it.

---

<div class="post-metadata">

**Author:** ![xr37](https://community.openhab.org/letter_avatar_proxy/v4/letter/x/e56c9b/32.png) [@xr37](https://community.openhab.org/u/xr37)\
**Post date:** [November 24, 2025, 5:55pm UTC](https://community.openhab.org/t/clearing-cache-results-on-loss-of-admin-user-and-sitemap/167298/6 "2025-11-24T17:55:25Z")

</div>

> [@rlkoshak](#):
>
> Did you try to just restore your config from 4.3 over to a new 5.0 install instead of doing an in place upgrade?

Yes, I did all these:

- Upgrade to 5.0.2, without restore → ☹
- Upgrade to 5.0.2, with restore → ☹
- Install 5.0.2 anew, restore, run upgradeTool → ☺
- Install 5.0.2 anew, restore, run upgradeTool, **clear cache** → I haven’t tried. I might give it a go later (on a spare computer) and see if that break things. I guess we all agree that it shouldn’t, right?

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [November 24, 2025, 6:21pm UTC](https://community.openhab.org/t/clearing-cache-results-on-loss-of-admin-user-and-sitemap/167298/7 "2025-11-24T18:21:29Z")

</div>

> [@xr37](#):
>
> I guess we all agree that it shouldn’t, right?

Correct. It shouldn’t. tmp is just temporary files. cache is where add-ons get installed to. Removing the cache causes the reinstallation of the add-ons, which is what you want when upgrading and in cases where there are problems related to add-ons being installed or initialized.

Clearing the cache does not impact any settings.

Note, the difference between a normal backup and a full backup is the cache and tmp are included in the full backup.
