SpamAssassin -- Upgrade from Private Installation

This page is obsolete, but is kept available for reference.

If you were previously using a privately-installed version of SpamAssassin, you should follow the recommendations below. NOTE: If you have any privately-installed SpamAssassin programs in your execution PATH, you may encounter problems. Before proceeding, either remove these privately-installed SpamAssassin programs or make sure they are at the end of your execution PATH, not near the beginning, so the system-supplied SpamAssassin programs are always executed.

You probably already have a user_prefs file in your .spamassassin directory. Manually combine your personal settings in this file with the global defaults contained in the file:


Your previous SpamAssassin installation may already have collected some Bayesian tokens. If so, they will be in your .spamassassin directory in files whose names match ”bayes*”, such as:


You can import these into the new SpamAssassin's central database.

First, use sa-learn at least once with the –spam or –ham option (as described in the Bayesian Filtering section on the page SpamAssassin to Identify Spam), so that the central database is correctly initialized for you. Otherwise the steps below may fail.

Then cd into your .spamassassin directory and use the following commands:

% sa-learn --siteconfigpath=/ --backup > data.txt
% sa-learn --restore data.txt

The first sa-learn command above will export your current Bayesian data into a file called ”data.txt”. Any error message of the form ”bayes: bayes db version 2 is not able to be used, aborting! …” can be safely ignored.

The second sa-learn command will import data from ”data.txt” into the central database.

Both sa-learn commands above can take a while, depending on the size of your existing Bayesian data.

After the –restore step above, you can check the size of the imported data with:

% sa-learn --dump magic

Look at the ”nham'”' and ”nspam” values to get a count of non-spam and spam tokens respectively in the database. After the import has been done, you can delete the ”bayes*” files in your .spamassassin'' directory thus:

% rm bayes*
classic/spamassassin_--_upgrade_from_private_installation.txt · Last modified: 2009-10-25 04:54 by admin
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki