Mapdb problem after Update 4.3.11 to 5.2.1

My Mapdb database seems to be corrupt after update from 4.3.11 to 5.2.1
Several self defined items are not persistet anymore so they are Null after restart of openhab service. How can I solve this problem without loosing all persisted data of Mapdb.

Mapdb.persist is:
Items {
* : strategy = everyChange, restoreOnStartup
}

The first two logs of openhab.log:

2026-09-20 15:23:35.096 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method ‘QueryablePersistenceService.persistedItem()’ on 'org.openhab.persistence.mapdb.in>
java.lang.AssertionError: data were not fully read, check your serializer
at org.mapdb.Store.deserialize(Store.java:299)
at org.mapdb.StoreDirect.get2(StoreDirect.java:486)
at org.mapdb.StoreWAL.get2(StoreWAL.java:336)
at org.mapdb.StoreWAL.get(StoreWAL.java:320)
at org.mapdb.Caches$HashTable.get(Caches.java:246)
at org.mapdb.EngineWrapper.get(EngineWrapper.java:58)
at org.mapdb.BTreeMap.get(BTreeMap.java:602)
at org.mapdb.BTreeMap.get(BTreeMap.java:589)
at org.openhab.persistence.mapdb.internal.MapDbPersistenceService.persistedItem(MapDbPersistenceService.java:250)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:149)
at org.openhab.core.internal.common.Invocation.call(Invocation.java:52)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)

2026-09-20 15:23:35.166 [ERROR] [ence.internal.PersistenceManagerImpl] - Exception occurred while querying persistence service ‘mapdb’ to restore ‘EG_SonosFenster_Power_Watts’: data were not ful>
java.lang.AssertionError: data were not fully read, check your serializer
at org.mapdb.Store.deserialize(Store.java:299)
at org.mapdb.StoreDirect.get2(StoreDirect.java:486)
at org.mapdb.StoreWAL.get2(StoreWAL.java:336)
at org.mapdb.StoreWAL.get(StoreWAL.java:320)
at org.mapdb.Caches$HashTable.get(Caches.java:246)
at org.mapdb.EngineWrapper.get(EngineWrapper.java:58)
at org.mapdb.BTreeMap.get(BTreeMap.java:602)
at org.mapdb.BTreeMap.get(BTreeMap.java:589)
at org.openhab.persistence.mapdb.internal.MapDbPersistenceService.persistedItem(MapDbPersistenceService.java:250)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:149)
at org.openhab.core.internal.common.Invocation.call(Invocation.java:52)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)

You could try to cause these items to rewrite to the database by manually updating them to what ever value you need. Watch the log for errors writing.

If that fails, you need to restore from a working backup or regenerate the DB by deleting it and repopulating it.

If you need to repopulate it, most of your items will do so almost immediately on that first boot after deleting the file since the Items will change as soon as the Things come online. You’ll have to manually update your more slowly changing Items or Items not linked to a Channel.

MapDB only stores one value per Item so you will not be losing any history or anything like that.

Thanks Rich for your quick response.
An update of these items doesn’t trigger a rewriting in mapdb.
Unfortunately due to the Update from 4.3.11 to 5.2.1 I have no backup of 5.2.1 and using the old working mapdb of 4.3.11 leads also to an mapdb error in 5.2.1.
So the only way seems to be to delete the mapdb database files as you suggest and manually update all non channel related items afterwards.
Should I stop OpenHAB service before deleting the files?

yes, stop openHAB first so MapDB is not held open. I’d copy the whole userdata/persistence/mapdb directory somewhere, then remove only the broken MapDB database files and start it again. Keep mapdb.persist. The items will repopulate as states arrive, but restoreOnStartup will not recover old values from the broken store. On a package install that is usually sudo systemctl stop openhab, back up /var/lib/openhab/persistence/mapdb, delete the broken files, then sudo systemctl start openhab. Check the log on first startup.