Date Tags sympa

I had to migrate a sympa installation from one domain to another. The sympa manual is certainly not of a much help. After a bit of trial and error this is my recipe.

A small warning: keep your backup available at all times. This procedure works with grep, sed and friends and it is not certainly fool proof.

  • Switch off your MTA and sympa daemon. From this moment on, you will have about 12h to finish your migration. After this time, you might start to loose incoming emails.

  • Dump the sql database. With mysql you can use mysqldump to obtain a copy of you db. Since the sympa daemon if off, it should be safe to perform a hot dump.

olddomain# mysqldump sympa > sympa.sql
  • Make a backup of your archives. On debian everything you need should be in /var/lib/sympa. Moreover you should remember to make a backup copy of /etc/sympa.
olddomain# tar zcvf sympa.tgz /var/lib/sympa
  • If you are migrating sympa to a different machine, this is a good time to copy everything there, configure the MTA to accept messages for the new domain. Since nobody knows about this new domain yet (you should give yourself a bit of time to test it !), you can switch on the MTA and sympa.

  • Now it’s time to recreate the sympa db. But before that, you need to do a bit of sed magic in the db dump file. The problem here is that the domain of all your mailing lists is in the database. If you are using a domain for your lists, then it should be easy.

newdomain# cat dump | sed -i 's/sympa.olddomain.org/sympa.newdomain.org/g' > dump.new
  • Ok then. We are ready to load the new dump in the db and start the sql server. Remeber also to change the domain in the configuration files in the /etc/sympa directory. If everything goes according to plans, you should be able to see the list of all you mailing lists.
newdomain# mysql sympa < dump.new
  • Almost done. We need to fix the config files for each list. This should do :
for i in `find -name config` ; do cp $i /var/lib/sympa/expl/sympa.newdomain.org/$i.sed ; done

for i in `find -name config` ; do sed 's/sympa\.olddomain\.org/sympa\.newdomain\.org/' < $i.sed > $i ; done
  • What is left to do it to recreate the archives. Sympa can recreate the entire web archives from the mailing lists row mboxes. To make this work, you need to change the name of all directories in /var/lib/wwsarchive. What I’ve done is something like:
newdomain# cd /var/lib/wwsarchive
newdomain# for i in `ls` ; do mv $i ${i/@sympa.olddomain.org/@sympa.newdomain.org} ; done
  • Now go to the admin interface of sympa and ask for a complete rebuild of the web archives. This should schedule the rebuild. You can check the sympa logs to make sure the procedure worked. In a few minutes, depending on the size of you archives, you should be able to access your web archives.

  • Now it’s time to add a rewrite or redirect in you old MTA to send all emails for you old domain, to the new domain. Then you should restart the old MTA, and see all the email flowing to the new sympa daemon. In order to completely remove the old domain, you should add a permanent error sometimes in the future.

NOTA (molto) BENE

I still think that sympa is a bloated and badly written piece of software. It is developed and sponsored by a consortium of French universities. If you want an efficient and manageable mailing list manager you should look somewhere else.

Update

Just for comparison… today I migrated a mailman installation to a new server. Well, the gist is (more or less) tar zcvf mailman.tgz /var/lib/mailman && scp mailman.tgz newhost: && cd /var/lib && tar zxvf mailman.tgz . Configure/Start mailman. The rest is history.

Ahhh if you change domain, there is a nice script called fix_url in the mailman directory. To easy to beat a dead horse, isn’t ?