[elephant-devel] HEAD upgraded to BDB 4.4 / Requires Upgrade Procedure

Ian Eslick eslick at csail.mit.edu
Mon Sep 4 05:03:07 UTC 2006


If you are working from the latest HEAD and using BDB you'll need to
take the following steps to upgrade your BDB databases to work with
check-ins as of September 3rd)

[This info can be found in UPGRADE-BDB in the elephant root directory]

1) Install BDB 4.4.20 or later just as you installed BDB 4.3.x

2) Pull the latest HEAD from CVS

3) Update config.lisp and Makefile in elephant root to point to the
appropriate directories

4) Rebuild elephant C libraries

In the root directory:
> make clean
> make
> make bdb

5) Upgrade your database directory (only log files need updating)

>From Sleepycat documentation:

   1. Shut down the old version of the application.
   2. Run recovery on the database environment using the DB_ENV->open
      <http://www.sleepycat.com/docs/api_c/env_open.html> method or the
      db_recover <http://www.sleepycat.com/docs/utility/db_recover.html>
      utility.
   3. Remove any Berkeley DB environment using the DB_ENV->remove
      <http://www.sleepycat.com/docs/api_c/env_remove.html> method or an
      appropriate system utility.
   4. Archive the database environment for catastrophic recovery. See
      Archival procedures
      <http://www.sleepycat.com/docs/ref/transapp/archival.html> for
      more information.
   5. Recompile and install the new version of the application.
   6. Force a checkpoint using the DB_ENV->txn_checkpoint
      <http://www.sleepycat.com/docs/api_c/txn_checkpoint.html> method
      or the db_checkpoint
      <http://www.sleepycat.com/docs/utility/db_checkpoint.html> utility.
   7. Restart the application.

A known good procedure:

     1. Cleanly exit lisp/elephant application
     2. Run 'db_recover' in database directory using 4.3 tools
     3. This will remove the environment
     3.b (optional)  Run 'db_checkpoint -1' and 'db_archive -d' to
checkpoint and update db files to latest log.  This will
                             snapshot the DB and allow you to backup
less data, but it makes catastrophic recovery to any time
                             before the snapshot impossible as you are
deleting history with the '-d' option so exclude that if you
                             are conservative or aren't sure what you're
doing.
     4. Copy your database files and all log files to a backup
     5. Run 'db_checkpoint -1' using 4.4 tools (ignore error message)
     6. Restart lisp, reload application and ensure that the latest
elephant source has been fully recompiled

6) Connect to your DB, all should be well! 

This procedure worked for my Mac OS X upgrade from BDB 4.3 using the
latest HEAD on a very large, complex DB.





More information about the elephant-devel mailing list