Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mapdb] Recreate DB when incompatible OH2 DB is used #9299

Merged
merged 1 commit into from
Dec 12, 2020

Conversation

wborn
Copy link
Member

@wborn wborn commented Dec 8, 2020

The only way to recover from an incompatible OH2 database is to create a new database.
With these changes the add-on will create a new database automatically and archive the incompatible database files in a backup directory.

Fixes #8794


It will for instance log:

21:07:36.351 [WARN ] [apdb.internal.MapDbPersistenceService] - The MapDB in /openhab/userdata/persistence/mapdb/storage.mapdb is incompatible with openHAB 3.0.0: org.openhab.persistence.mapdb.internal.MapDBitemSerializer cannot be found by org.openhab.persistence.mapdb_3.0.0.202012082007. A new and empty MapDB will be used instead.
21:07:36.353 [INFO ] [apdb.internal.MapDbPersistenceService] - Moved incompatible MapDB file '/openhab/userdata/persistence/mapdb/storage.mapdb.p' to '/openhab/userdata/persistence/mapdb/backup/1607458056352--storage.mapdb.p'
21:07:36.353 [INFO ] [apdb.internal.MapDbPersistenceService] - Moved incompatible MapDB file '/openhab/userdata/persistence/mapdb/storage.mapdb.t' to '/openhab/userdata/persistence/mapdb/backup/1607458056352--storage.mapdb.t'
21:07:36.353 [INFO ] [apdb.internal.MapDbPersistenceService] - Moved incompatible MapDB file '/openhab/userdata/persistence/mapdb/storage.mapdb' to '/openhab/userdata/persistence/mapdb/backup/1607458056352--storage.mapdb'

@wborn wborn added the bug An unexpected problem or unintended behavior of an add-on label Dec 8, 2020
@wborn wborn requested a review from a team December 8, 2020 20:33
@wborn wborn added rebuild Triggers Jenkins PR build and removed rebuild Triggers Jenkins PR build labels Dec 9, 2020
@wborn wborn force-pushed the mapdb-incompatibility branch from d85d79a to f2e50e1 Compare December 9, 2020 14:13
@wborn wborn added rebuild Triggers Jenkins PR build and removed rebuild Triggers Jenkins PR build labels Dec 9, 2020
@wborn wborn force-pushed the mapdb-incompatibility branch from f2e50e1 to bb4e675 Compare December 9, 2020 22:46
The only way to recover from an incompatible OH2 database is to create a new database.
With these changes the add-on will create a new database automatically and archive the incompatible database files in a backup directory.

Fixes openhab#8794

Signed-off-by: Wouter Born <[email protected]>
@wborn wborn force-pushed the mapdb-incompatibility branch from bb4e675 to 6fbfa89 Compare December 11, 2020 00:46
@J-N-K J-N-K merged commit 9ee81ea into openhab:main Dec 12, 2020
@wborn wborn deleted the mapdb-incompatibility branch December 12, 2020 18:24
@J-N-K J-N-K added this to the 3.0.0.RC1 milestone Dec 12, 2020
marcfischerboschio pushed a commit to bosch-io/openhab-addons that referenced this pull request May 5, 2022
The only way to recover from an incompatible OH2 database is to create a new database.
With these changes the add-on will create a new database automatically and archive the incompatible database files in a backup directory.

Fixes openhab#8794

Signed-off-by: Wouter Born <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
2 participants