|
When upgrading to a new release of Berkeley DB, it may be necessary to upgrade the on-disk format of already-created database files.
It is important to realize that Berkeley DB database upgrades are done in place, and so are potentially destructive. This means that if the system crashes during the upgrade procedure, or if the upgrade procedure runs out of disk space, the databases may be left in an inconsistent and unrecoverable state.
To guard against failure, the following procedure should be followed:
To cleanly shutdown database operations, all applications accessing the database environment must be shutdown and a transaction checkpoint must be taken. If the applications are not implemented such that they can be shutdown gracefully (i.e., closing all references to the database environment and taking a database checkpoint), recovery must be performed after all applications have been killed to ensure that the underlying databases are consistent and up-to-date on disk.
This archival is not strictly necessary. However, if you have to perform catastrophic recovery after restarting your applications, that recovery must be done based on the last archive you have made. If you make this archive, you can use it as the basis of your catastrophic recovery. If you do not make this archive, you will have to use the archive you made in step #2 as the basis of your recovery, and you will have to upgrade it as described in step #3 before you can apply your log files to it.
After an upgrade, Berkeley DB applications must be recompiled to use the new Berkeley DB library before they access an upgraded database. There is no guarantee that applications compiled against previous releases of Berkeley DB will work correctly with an upgraded database format. Nor is there any guarantee that applications compiled against newer releases of Berkeley DB will work correctly with the previous database format. We do guarantee that any archived database may be upgraded using a current Berkeley DB software release and the DB->upgrade method, and there is no need to step-wise upgrade the database using intermediate releases of Berkeley DB. Sites should consider archiving appropriate copies of their application or application sources if they may need to access archived databases without first upgrading them.