You are here: Advanced Features > Defragment > Defragmentation Configuration > Delete The Backup

Delete The Backup

The defragmentation process copies the data from the old database to a new file. The old file is left as a backup. You can force the defragmentation process to delete the backup after a successful defragmenting.

DefragmentConfig config = new DefragmentConfig("database.db4o");
config.forceBackupDelete(true);

Defragment.defrag(config);
DefragmentationConfigurationExamples.java: Delete the backup after the defragmentation process