Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You may need to perform the "dump" step on the original machine, and the db_dump and db_load tools may have different names on your platform.

Note that some OS'es (like Debian!) install DB version 4.1, but using DB version 3.x for it's DB_File support! Use the "file" tool to find out what version is what:

No Format

file /home/jm/.spamassassin/bayes_*
/home/jm/.spamassassin/bayes_seen:  Berkeley DB (Hash, version 5, native byte-order)
/home/jm/.spamassassin/bayes_toks:  Berkeley DB (Hash, version 5, native byte-order)
/home/jm/.spamassassin/bayes_toks.copied: Berkeley DB (Hash, version 8, native byte-order)

"Version 5" is db3.x, "Version 8" is db4.x. Confused yet? Don't blame us, we only work here. You need to install db3-utils to get the "db3_load" command to save in a format that the DB_File module (and therefore SpamAssassin) can use.

(On Debian, don't install an older "-dev" package, like "libdb2-dev", as it'll override the newer stuff. You just need "libdb2" and "libdb2-utils", or "libdb4.3" and "db4.3-util", or similar.)

If all else fails, just convert the entire DB to text using this tool: http://spamassassin.taint.org/devel/db-to-text.pl.txt , and it's "-o" switch, and convert from text into the DB_File DB format on the other side using the same tool and the "-i" switch.

DB 1.8.5 to DB 4.2.x

db_load and db_dump as documented above are mostly useful for close versions. Converting between more dissimilar versions requires a little more work. To go from 1.8.5 to 4.2.x, you need to dump using the db_dump185 tool which is included in the tarball for 4.2.x but isn't always built. To build it, download and extract the tarball and then do this:

No Format

cd build_unix/
../dist/configure --enable-dump185
make

Of course, this will fail if you don't have the libs for 1.8.5 around - so build this on the old system, then dump the files, then move the dumps to the new system, and then finally, use db_load as described above to import them.

Other Dbs

You can do the same with the bayes_seen and auto-whitelist files, but they're not as important; I generally just blow them away:

...