JE Backup and Restore

To backup your database, copy the log files (the .jdb files) starting from the lowest numbered log file to the highest numbered log file to your backup media. Be sure to copy the bytes of the individual database files in order from the lowest to the highest. You do not have to close your database or otherwise cease database operations when you do this.

Note

Note that if you are using subdirectories to store your log files, then you should copy those subdirectories and their contents instead of simply copying individual files. Multiple subdirectories can be used to improve JE throughput, but this feature is not turned on by default. See Multiple Environment Subdirectories for information on how to configure this feature.

Restoring a JE database from a backup consists of closing your JE environment, copying archived log files back into your environment directory and then opening your JE environment again. If you are using subdirectories to store your log files, then make sure to copy those subdirectories back into the environment home directory, and make sure the same log files are in each subdirectory as was there when you took the backup.

Note that whenever a JE environment is opened, JE runs normal recovery. This involves bringing your database into a consistent state given the changed data found in the database. If you are using transactions during normal operations, then JE automatically runs checkpoints for you so as to limit the time required to run this recovery. In any case, running normal recovery is a routine operation, while performing database restores is not.

For more information on JE backup and restores, and on checkpoints, see Backing up and Restoring Berkeley DB Java Edition Applications.