[Mailman-Users] Moving a List

Lindsay Haisley fmouse-mailman at fmp.com
Fri Jan 30 20:11:20 CET 2009


On Fri, 2009-01-30 at 11:52 -0500, Jeff Bernier wrote:
> I have seen those FAQs, and they instruct on moving ALL lists. I have
> just one list to move. I am able to go into the mailman/lists and
> mailman/archives directories and pull out just the objects belonging
> to the list I want to move... but when I look in the mailman/data
> directory, I cannot identify any files or directories relating to my
> ONE list. I am concerned that if I copy the entire contents of
> mailman/data to the new server, I will break something.

Here are the scripts I use.  DON'T use these as-is, just read code to
understand the procedure.

This script gets run on as root on the box from which the list is being
moved:

#!/bin/sh
if [ "$1" = "" ]; then
        echo 'Usage: tar_list.sh <listname>'
        exit
fi

if [ ! -e /var/lib/mailman/lists/$1 ]; then
        echo "$1: No such list!"
        exit
fi

mkdir /tmp/$1
cd /var/lib/mailman/lists/

echo Creating $1_list.tar.gz ....
tar -czvf $1_list.tar.gz $1
mv $1_list.tar.gz /tmp/$1

cd /var/lib/mailman/archives/private/

echo Creating $1_archive.tar.gz ....
tar -czvf $1_archive.tar.gz $1
mv  $1_archive.tar.gz /tmp/$1

echo Creating $1_archive_mbox.tar.gz ....
tar -czvf $1_archive_mbox.tar.gz $1.mbox
mv $1_archive_mbox.tar.gz /tmp/$1

if [ -L /var/lib/mailman/archives/public/$1 ]; then
        touch /tmp/$1/$1_archive_is_public
fi

-----------------------
This script gets run as user mailman on the receiving box:

#!/bin/sh
if [ "$1" = "" ]; then
        echo 'Usage: untar_list.sh <listname>'
        exit
fi

cd ~/tmp/
echo "Give root password on remote system ..."
scp root at shanti-vpn.fmp.com:/tmp/$1/* .
cd /var/lib/mailman/lists/

echo ""
echo "Creating list $1 ..."
tar -xzvpf ~/tmp/$1_list.tar.gz

cd /var/lib/mailman/archives/private/

echo ""
echo "Creating archive for $1 ..."
tar -xzvpf ~/tmp/$1_archive.tar.gz

echo "Creating archive mbox for $1 ..."
tar -xzvpf ~/tmp/$1_archive_mbox.tar.gz

if [ -e ~/tmp/$1_archive_is_public ]; then
        ln -s /var/lib/mailman/archives/private/$1 /var/lib/mailman/archives/public/$1
fi

echo""
echo "If no errors, delete files in ~/tmp and delete /tmp/$1 directory on remote system"

---------------------------

If you're using an older version of mailman on either system which puts
things under /usr/local/mailman then you'll need to make allowances for
this in the paths.  Note that the tarball containing the list to be
moved contains a zero-length file, <listname>_archive_is_public which is
just a flag file to direct the script on the receiving side to create
the appropriate symlink for public archives.

These scripts work fine for me, and I've used them successfully, with
minor variations, on two different major moves.

-- 
Lindsay Haisley       | "The difference between |     PGP public key
FMP Computer Services |  a duck is that one leg |      available at
512-259-1190          |    is  both the same"   | http://pubkeys.fmp.com
http://www.fmp.com    |       - Anonymous       |



More information about the Mailman-Users mailing list