DB_VERSION_MISMATCH -- a solution
David Relson
relson at osagesoftware.com
Sun Jan 16 22:29:23 CET 2005
Greetings all,
A bit of research indicates that changing versions of Berkeley DB isn't
all that difficult to do. For versions 4.2 and 4.3 the database itself
is in the same format. The log files, however, are in different formats.
To change versions, it's necessary to run db_recover, specifically for
the release of Berkeley DB used to create the wordlist. Using
"db_recover -c" puts the database in a consistent state so that the log
files can be removed. Once that's done, the wordlist can be used with a
different version of Berkeley DB.
To illustrate this, I've put together the attached script, named
test_db_upgrade. As written, it assumes that old and new versions of
bogoutil and of Berkeley DB are present. On my system I have:
~/bin/bogoutil-4.2
~/bin/bogoutil-4.3
/usr/local/BerkeleyDB.4.2/bin/db_recover
/usr/local/BerkeleyDB.4.3/bin/db_recover
The script uses "bogoutil-$OLD" to load a wordlist (from a text file),
runs ...$OLD/bin/db_recover, removes the log files, runs "bogoutil-$NEW"
to dump the wordlist (as a text file), then runs md5sum to show that the
input and output text files are the same. Below is output from a 4.2 to
4.3 test and from a 4.3 to 4.2 test.
### testing 4.2 to 4.3 ###
[relson at osage src]$ test_db_upgrade 4.2 4.3 wordlist.old.txt wordlist.new.txt
Loading wordlist.db
Running db_recover
Dumping wordlist.db
088d241fe348e393971f8bbf7448e257 wordlist.old.txt
088d241fe348e393971f8bbf7448e257 wordlist.new.txt
### testing 4.3 to 4.2 ###
[relson at osage src]$ test_db_upgrade 4.3 4.2 wordlist.old.txt wordlist.new.txt
Loading wordlist.db
Running db_recover
Dumping wordlist.db
088d241fe348e393971f8bbf7448e257 wordlist.old.txt
088d241fe348e393971f8bbf7448e257 wordlist.new.txt
Hope this helps!!!
David
More information about the Bogofilter
mailing list