[Mailman-Users] Moving Configurations and Lists to a New Server

Lindsay Haisley fmouse at fmp.com
Thu Jun 5 19:13:30 CEST 2014


On Thu, 2014-06-05 at 12:43 -0400, Steve Matzura wrote:
> This reply mechanism is driving me a little weird--the reply function
> sends the messages to their individual authors, not the list. I hope
> I'm not breeching etiquette by redirecting my reply to the list.

Not at all!  Most mail user agents can detect a list post and will offer
a choice of whether to reply to the list  or the original poster.  Yours
apparently can't do this.  If the "reply to all" options is available
the list address will be included and you can just delete the original
poster address.

> Thanks, Mark, for your cogent and complete reply.
> 
> The short answer and good thing about all of this is, the new system
> is supposed to be an as-near-100% replica as is possible of the old
> system, just everything re-installed and new, just keeping the old
> data. The new system already has the same identity and nameserver info
> as the old, the idea being to move data and other applications (which
> is already underway) and then switch the DNS records after the new
> environment has been thoroughly tested. I'll check the wiki's you
> mentioned and report on progress when done.

Mark's answer was very complete and I won't try to add any details, but
since I've had to move lists between servers in situations pretty much
identical to what you describe I thought I'd offer a couple scripts
which I've used quite successfully to move entire lists - subscribers,
archives, etc.  There's no need to set them up on the receiving server
ahead of time.

This is the script, called tar_list.sh and run as root on the source
server, which creates an archive directory and contents in /tmp:

#!/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

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

The second script, called untar_list.sh lives in ~mailman/bin and is run
as user mailman on the receiving server:

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

cd ~/tmp/
echo "Give root password on remote system ..."
scp root@$1:/tmp/$2/* .
cd /var/lib/mailman/lists/

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

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

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

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

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

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

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

This requires a couple of things which may not be advisable for
permanent use from a security perspective.

* The unprivileged user "mailman" should have a shell login on the old
server.

* The unprivileged user "mailman" on the new server must have ssh access
to a root login on the old server.  sshd can be configured to
selectively allow this only from a very limited number of accounts on
other servers.

As I said, I've used these scripts successfully for a couple of
different moves of our dozen or so lists between servers when migrating
to a new server environment, and they've been subjected to a few tweaks
here and there so that they work flawlessly for me at this point.
They're self-documenting and transparent to error messages.

-- 
Lindsay Haisley       | "Everything works if you let it"
FMP Computer Services |
512-259-1190          |          --- The Roadie
http://www.fmp.com    |



More information about the Mailman-Users mailing list