mapdb icon indicating copy to clipboard operation
mapdb copied to clipboard

convert DB from version 1 to 3

Open avishayh opened this issue 8 years ago • 3 comments

Hi I'm trying to upgrade my app from version 1.0.9 to latest 3.0.5.

In 1.0.9 I used the encryptionEnable method on my mapdb file

DBMaker.newFileDB(new File(dbFileName)) .closeOnJvmShutdown() .encryptionEnable(dbPassword.getUnderline()) .make();

when converting to version 3, the encryptionEnable was removed.

How can I migrate my data ?

avishayh avatar Jul 17 '17 12:07 avishayh

when trying to open the file created in version 1.0.9 with 3.0.5 I get this exception:

Caused by: org.mapdb.DBException$WrongFormat: Wrong file header, not MapDB file at org.mapdb.StoreDirectAbstract.fileHeaderCheck(StoreDirectAbstract.kt:99) at org.mapdb.StoreDirect.(StoreDirect.kt:114) at org.mapdb.StoreDirect$Companion.make(StoreDirect.kt:57) at org.mapdb.StoreDirect$Companion.make$default(StoreDirect.kt:56) at org.mapdb.DBMaker$Maker.make(DBMaker.kt:450)

avishayh avatar Jul 18 '17 12:07 avishayh

Same here. Documents and examples about migration is needed. Current version is v1.0.9 and it's real hard to do the upgrade.

Anthonyeef avatar Nov 30 '17 04:11 Anthonyeef

I think you basically have to

  1. make a shadow jar of mapdb 1.x
  2. make a shadow jar of mapdb 3.x
  3. create a java project where you load both libraries from step 1 and 2 then open the mapdb 1.x and feed the tables from your application into mapdb 3.x table

nddipiazza avatar Aug 09 '18 19:08 nddipiazza