<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
                   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<refentry id='bogoupgrade.1'>
<refmeta>
<refentrytitle>bogoupgrade</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo class="manual">Bogofilter Reference Manual</refmiscinfo>
<refmiscinfo class="source">Bogofilter</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>bogoupgrade</refname>
<refpurpose>upgrades <application>bogofilter</application> database to
current version</refpurpose>
</refnamediv>
<refsynopsisdiv id='synopsis'>

<cmdsynopsis>
  <command>bogoupgrade</command>
  <arg choice='opt'>-h</arg>
  <arg choice='plain'>-d <replaceable>directory</replaceable></arg>
  <arg choice='opt'>-i <replaceable>input file</replaceable></arg>
  <arg choice='opt'>-o <replaceable>output file</replaceable></arg>
  <arg choice='opt'>-b <replaceable>path to bogoutil</replaceable></arg>
</cmdsynopsis>

</refsynopsisdiv>

<refsect1 id='description'><title>DESCRIPTION</title>
<para><command>bogoupgrade</command> is a command to upgrade
<application>bogofilter</application>'s databases from an old format
to the current format. Since the format of the database changes once
in a while, the utility is designed to make the upgrade easy.</para>
</refsect1>

<refsect1 id='options'><title>OPTIONS</title>

<para>The <option>-h</option> option prints the help message and exits.</para>

<para>The <option>-d</option> specifies the directory with the wordlists for
converting.  This option is used when converting from multiple, separate 
wordlists (spamlist.db and goodlist.db - containing spam and ham tokens, 
respectively) to a combined wordlist (wordlist.db) which contains both spam 
and ham tokens.</para>

<para>The <option>-i</option> specifies the input file to be converted. It
should be a text file containing message counts, and possibly data. If there is
no data in the text file, there should be a  Berkeley DB file in the same
directory as the text file which contains the data.</para>

<para>The <option>-o</option> specifies the output Berkeley DB file.</para>

<para>The <option>-b</option> gives the path to the <command>bogoutil</command>
command. It defaults to 'bogoutil', in the hopes that your shell will find
it.</para>
</refsect1>

<refsect1 id='upgrading'><title>UPGRADING</title>
<para>Follow these instructions to upgrade
<application>bogofilter</application>'s databases to the latest version.</para>

<orderedlist>
<listitem><para>Stop all instances of <application>bogofilter</application>.
While the upgrade tools lock the database files, the upgrade may take a long
time if you have a busy site.  Don't forget to stop cron jobs or daemons that
fetch and process mail and could fire off
<application>bogofilter</application>.</para></listitem>

<listitem><para>Backup your data. Let's assume that you said:</para>
<screen>
<prompt>$</prompt> <userinput>mv ~/.bogofilter ~/.bogofilter.safe</userinput>
<prompt>$</prompt> <userinput>mkdir ~/.bogofilter</userinput>
</screen></listitem>

<listitem><para>If your <application>bogofilter</application> version is less
than 0.7, say:</para>
<screen>
<prompt>$</prompt> <userinput>bogoupgrade -i ~/.bogofilter.safe/goodlist -o ~/.bogofilter/goodlist.db</userinput>
<prompt>$</prompt> <userinput>bogoupgrade -i ~/.bogofilter.safe/badlist -o ~/.bogofilter/spamlist.db</userinput>
</screen>
<para>If your <application>bogofilter</application> version is 0.7 or greater,
say:</para>
<screen>
<prompt>$</prompt> <userinput>bogoupgrade -i ~/.bogofilter.safe/hamlist.count -o ~/.bogofilter/goodlist.db</userinput>
<prompt>$</prompt> <userinput>bogoupgrade -i ~/.bogofilter.safe/spamlist.count -o ~/.bogofilter/spamlist.db</userinput>
</screen></listitem>

<listitem><para>Current versions of <application>bogofilter</application> use a combined wordlist that holds both spam and non-spam tokens.  It is named wordlist.db.  If you're updating from a version older than 0.14.0 that has separate wordlists (named goodlist.db and spamlist.db), use:</para>
<screen>
<prompt>$</prompt> <userinput>bogoupgrade -d ~/.bogofilter.safe</userinput>
</screen></listitem>

<listitem><para>Done. Restart any stopped daemons, cron tasks,
etc.</para></listitem>
</orderedlist>
</refsect1>

<refsect1 id='author'><title>AUTHOR</title>
<para><command>bogoupgrade</command> was written by 
Gyepi Sam <email>gyepi@praxis-sw.com</email> and 
David Relson <email>relson@osagesoftware.com</email>.</para>
<para>For updates, see <ulink url="http://bogofilter.sourceforge.net/">the
bogofilter project page</ulink>.</para>
</refsect1>

<refsect1 id="also">
    <title>SEE ALSO </title>
    <para>bogofilter(1), bogolexer(1), bogotune(1), bogoutil(1)</para>
</refsect1>
</refentry>
