Dealing with BerkeleyDB version mismatches

If you see errors like this:

Program version 4.6 doesn't match environment version 4.5
DB_ENV->open: DB_VERSION_MISMATCH: Database environment version mismatch

after an upgrade (to Fedora 8 in my case) it’s just that the old database cache files need to be removed. BDB will re-generate them.

In my case I did:

locate __db. | grep -v snapshots | xargs rm

which deleted all the caches that weren’t in my backups. Obviously, know what you’re piping to rm!