Migrating mailman lists

Posted by anurag on Wed 28 Nov 2007 at 10:15

A couple of weeks back we had to migrate a few mailman based mailing lists across to a new server. Migration was successful and we had minimum downtime, since no changes were applied to the lists, they were simply moved to a new home. Here is how we did it.

1. Introduction
This HowTo assumes that the new server uses Postfix as an MTA. Using any other MTA is not a problem as long as it can read the Mailman generated aliases file.

Migrating mailman lists is a 3 step process.

2. Preparing New Server.
  • 2.1 Installing Mailman.

  • Follow the official Mailman installation documentation given at http://www.list.org and make sure new server has python, Apache, and mod_python installed. Mailman's source tarball and distribution supplied packages are equally good. Depending on what you are using, mailman's installation directory would be /usr/local/mailman (in case of source install) or /var/lib/mailman (in case of debian package).
  • 2.2 Configure Apache and Postfix.

  • If your mailing list uses a separate virtual host (highly recommended) then test out if Apache and postfix are correctly configured to serve a sample list.

3. Copying Data to New Server.
Copying data involves copying over three directories, which hold list configuration(lists), held messages/bounce stats(data) and list archives(archives).
  • 3.1 lists

  • Mailman stores its list specific settings like passwords, subscribers, list settings as python pickels in lists directory. First step in migrating list is to rsync this directory to the new server. You may copy over few selected lists, or all the lists using any means.

    For example, to copy all the lists from old server the new server, issue this command on the old server:

    # rsync -avz /usr/local/mailman/lists  root@new-server:/var/lib/mailman/


    Note: Above command will also replace the site wide mailing list named Mailman. So take backups if necessary.

  • 3.2 data

  • The data directory stores all the held messages and bounce events. This directory also contains site wide administrator password and an aliases file which is used by the MTA to identify available mailing lists.

    To copy data directory to the new server, issue this command on the old server.

    # rsync -avz /usr/local/mailman/data root@new-server:/var/lib/mailman/


    Note: Above command will also replace the site wide administrator password file. Backup the existing data directory if required.

  • 3.3 archives

  • The archives directory stores mailing list archives if it is enabled(enabled by default).

    To copy list archives, issue this command on the old server.
    # rsync -avz /usr/local/mailman/archives root@new-server:/var/lib/mailman/


4. Post Migration checks.
After the data is migrated, check for any permission issues. Its possible that the new server is configured to run mailman with the user list or mailman. Change the ownership of the directories copied accordingly.

  • 4.1 Regenerating Aliases

  • The bin directory present in mailman installation contains several command line utilities for managing mailing lists. First step after copying over all the data is to regenrate the ailases file. To generate aliases run:

    # cd /var/lib/mailman/bin
    # ./genaliases


  • 4.2 Hostnames

  • This step is not required if domain name of mailing lists remain same. In case the mailing lists are also changing their domain names, a few changes need to be made in the mailing lists too. Every MailList object has two attributes named web_page_url and host_name. These two attributes determine how mailman will write the list urls in the web pages it generates.

    To fix the URLs issue these commands.

    # cd /usr/local/mailman/bin
    # ./withlist -l -r fix_url LIST_NAME -u new-domain.example.org


  • 4.3 DNS Updates

  • After these steps are over, its time to do DNS updates. Move over to your DNS configuration options and point the list domain to new server's IP address.


5. Finalising
Try to send an email to any of the lists's -request alias, with `help' in the subject line. Mailman should immediately respond with a list of available commands.

6. Refrences
Mailman Homepage - http://www.list.org
Mailman Installation Manual -http://list.org/mailman-install/index.html

 

 


Posted by Anonymous (141.35.xx.xx) on Wed 28 Nov 2007 at 19:29
Nice article.
I noticed that some of your options to rsync are redundant. To be sure I searched in the manpage. "man rsync" says:
-a, --archive archive mode; same as -rlptgoD (no -H, -A)

So you could shorten that line in the article. But thank you anyhow for your contribution.

[ Parent | Reply to this comment ]

Posted by anurag (59.161.xx.xx) on Wed 28 Nov 2007 at 20:21
[ Send Message ]
Hi, thanks for pointing out! -- Anurag

[ Parent | Reply to this comment ]

Posted by Anonymous (64.105.xx.xx) on Sun 28 Sep 2008 at 00:02
And after you do the move and the withlist change and everything restart the mailman qrunner daemon to have it recognize your changes.

Or beat your head against a wall.

[ Parent | Reply to this comment ]

Posted by Anonymous (89.221.xx.xx) on Thu 22 Jan 2009 at 09:26
I had to also fix the permissions on the files on the new server. A minor issue, though.

[ Parent | Reply to this comment ]

Posted by Anonymous (112.121.xx.xx) on Thu 19 Aug 2010 at 10:25
New mailing lists are not archiving after the migration(old server to new server) Please help me on this one. thanks in advance.

[ Parent | Reply to this comment ]

Posted by fero (151.41.xx.xx) on Sun 27 Nov 2011 at 22:33
[ Send Message ]
I think you should point out that there could be issues about permissions if user differs from one system to another. This should not happen if they are both Debian systems, but it depends on sysadm needings.

Thank you for this guide. It has been useful to me

[ Parent | Reply to this comment ]

Posted by Anonymous (50.148.xx.xx) on Wed 20 Nov 2013 at 01:58
Seconded, although it's my fault. Lots of time fixing perms

[ Parent | Reply to this comment ]

Posted by Anonymous (134.89.xx.xx) on Thu 12 Jan 2012 at 17:35
Excellent. Many thanks for a concise and effective how-to.

Carlos

[ Parent | Reply to this comment ]

Sign In

Username:

Password:

[Register|Advanced]

 

Flattr

 

Current Poll

Which init system are you using in Debian?






( 1035 votes ~ 6 comments )