You are here: Advanced Features > Defragment > Defragmentation Configuration > Upgrade Database File

Upgrade Database File

This option will upgrade first the database file format and then defragment it. You need to specify a folder where the temporary data for this process is stored.

DefragmentConfig config = new DefragmentConfig("database.db4o");
config.upgradeFile(System.getProperty("java.io.tmpdir"));

Defragment.defrag(config);
DefragmentationConfigurationExamples.java: Upgrade database version