[I see this came up recently and no one replied:]
http://thread.gmane.org/gmane.mail.spam.spamassassin.general/51333

I'm not sure why I needed to do this (is it really not possible to
portably export and import Bayes DBs?), but in case it helps anyone...

I had a SpamAssassin Bayes database in my ~/.spamassassin directory
on a FreeBSD 4.10 box, and I needed to copy it over to a Mandrake Linux
10.0 box. For whatever reason, I couldn't just copy the raw files over;
SpamAssassin / sa-learn on the Mandrake box was unable to read them.

So, I whipped up a Python script, bayes_export.py, to do a full dump of
the database on the BSD box and store it in /tmp/bayes.zip.
I then scp'd this file over to the Mandrake box (to the same location,
/tmp/bayes.zip), and ran a second script, bayes_import.py, to
reconstruct the database there.

No guarantees, be sure to backup your files first, and
of course they could be made to be smarter and more flexible.
They did the job for me, though.

Here are colorized sources:
http://skew.org/bayes/colorized/bayes_export.py
http://skew.org/bayes/colorized/bayes_import.py

Here are raw sources:
http://skew.org/bayes/bayes_export.py
http://skew.org/bayes/bayes_import.py

Here is a tarball containing both scripts:
http://skew.org/bayes/bayes_tools.tgz

Reply via email to