Search code examples
javadatabasefilemapdb

MapDB file backup


I'm using a file-backed MapDB which I create like this:

File dbFile = new File("db");
DBMaker.newFileDB(dbFile)
    .closeOnJvmShutdown()
    .make();

I noticed that there are 3 files being created:

  1. db
  2. db.p
  3. db.t

I need a way store and retrieve a DB remotely. I need to use a single file (store a file / retrieve a file). Do I need all three files? I found that trying to recreate a DB from just the "main" file (db) throws an exception. Is there a way (some config option or something) I can tell MapDB to use only one file?

Thanks for your help


Solution

  • New MapDB 2 uses single file storage, so there is no .p file.

    .t file is transaction log and should be deleted if db is closed correctly.