The database-file which needs to be defragmented is specified in the configuration. The first constructor parameter is the database file.
DefragmentConfig config = new DefragmentConfig("database.db4o"); Defragment.defrag(config);
The defragmentation process creates a backup of the old database. By default the back-up file has the name of the original database-file with an additional '.backup'-suffix. You can explicitly specify the backup file name with the second constructor parameter.
DefragmentConfig config = new DefragmentConfig("database.db4o", "database.db4o.back"); Defragment.defrag(config);