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.
- 2.2 Configure Apache and Postfix.
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).
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.
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.
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
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
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.
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.
Mailman Homepage - http://www.list.org
Mailman Installation Manual -http://list.org/mailman-install/index.html