Mailman 3 people --
I am planning an upgrade for my Mailman 3 system, and I have a couple of questions.
I am currently running an old install of Mailman 3.3.5 on Debian Bullseye.
Rather than trying to upgrade this now ancient VM, my plan is to create a new VM and perform a fresh install of Mailman 3.3.10 on Debian Trixie.
I'd like advice on how to migrate mailing lists and archives from the old install to the new one. Is there a standard procedure?
My current implementation uses the Python venv installation method. I'd prefer a more container-focused installation, but since I don't believe Mailman 3 has official container images yet, I plan to continue with the venv approach. Please let me know your thoughts.
Thanks!
-- Stephen Daniel
Stephen,
I can't help with containered versions - I don't play docker if I can help it! From what I do know it shouldn't be too hard to docker-compose: alpine base image + python venv + data dir. Perhaps something like Claude Sonnet could help you?
I do have an Ansible role which can install mailman3 well enough:
https://github.com/rivimey/ansible-mailman3
I have found upgrading between versions relatively painless apart from the situation when the host python disappears under its feet when you do a dist-upgrade. My recommendation is to get all the non-python files copied over to the new VM, install the venv, run the 'migrates' for django, and see from there.
Regards,
Ruth
As an aside: I find that my mailman3 relatively frequently (as in once a month or so) fails to start properly because it can fail in a way systemd is unable to/doesn't know it needs/ to restart it. I run this script in cron to catch that:
#!/bin/bash
#
fn=/tmp/mm$$
trap "rm -f $fn" exit term
systemctl status mailman3-core >$fn
if grep -q 'Active: active (running)' $fn ; then
exit
fi
sleep 10
sudo systemctl restart mailman3-core
sleep 5
echo =-=-=-= >>$fn
systemctl status mailman3-core >>$fn
if grep -q 'Active: active (running)' $fn ; then
mailx -s 'Mailman3 systemctl status: restarted' root@ivimey.org
<$fn
exit
fi
mailx -s 'Mailman3 systemctl status: failure' root@ivimey.org <$fn
exit 1
I used to use this script, set to run by systemctl as an 'on boot' service, but the systemctl restart above seems to be sufficient at the moment:
The systemd service file (presumes mailman3 is run using the name mailman3-core, which might not be true for you):
[Unit]
Description=Unlock Mailman3 if system crashed and left lock files around
Wants=mailman3-core.service
Before=mailman3-core.service multi-user.target
After=basic.target
RefuseManualStart=true
[Service]
Type=simple
ExecStart=/usr/local/bin/mailman3-unlock.sh
Restart=no
KillMode=process
[Install]
WantedBy=multi-user.target
And the bash shell script referenced by the service. As you can see it checks to see if mailman is actually running before killing any locks! (presumes a location for the mailman3 installation, which is unlikely to be true for you):
#!/bin/sh
# Carefully unlock mailman3 in the case that it wasn't shut down
properly.
# If the lock files are left, mailman3 will refuse to start up.
# See if there is a mailman3 master process running... if so, unlocking
# is unsafe.
nprocs=$(ps ax |grep mailman3/bin/master |grep -v grep |wc -l)
if [ "$nprocs" -eq 0 ] ; then
if [ -f /opt/mailman3/var/core/master.lck ]; then
echo "mailman3-unlock: lock files found, unlocked" |
systemd-cat -p warning
rm -f /opt/mailman3/var/core/master.lck*
else
echo "mailman3-unlock: no locks" | systemd-cat -p info
fi
else
echo "mailman3-unlock: mailman3 is already running!" |
systemd-cat -p warning
exit 1
fi
exit 0
-- Software Manager & Engineer Tel: 01223 414180 Blog:http://www.ivimey.org/blog
On 8/3/26 6:41 AM, Stephen Daniel wrote:
I'd like advice on how to migrate mailing lists and archives from the old install to the new one. Is there a standard procedure?
Just point the new installation to the existing database(s) and run the django admin migrate command.
My current implementation uses the Python venv installation method. I'd prefer a more container-focused installation, but since I don't believe Mailman 3 has official container images yet, I plan to continue with the venv approach. Please let me know your thoughts.
See https://docs.mailman3.org/en/latest/install/docker.html
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mark Sapiro writes:
On 8/3/26 6:41 AM, Stephen Daniel wrote:
I'd like advice on how to migrate mailing lists and archives from the old install to the new one. Is there a standard procedure?
Just point the new installation to the existing database(s) and run the django admin migrate command.
You will get a working installation with all your lists in place with this simple approach. There are a few caveats that probably do NOT apply to you:
- You need your config files to be outside of Mailman's installation tree. (Most people have them in /etc/mailman3, so no problem.)
- You may have edited some template files in place in $var_dir. These edits need to be merged into the new ones, which may have changed. (Most people use Postorius to customize email templates, which are saved in the database rather than the file system. More installations have customized Postorius's own templates and CSS for corporate logos and disclaimers, etc., which need merging.)
- You may have customized the code, most likely by using an external text indexer for HyperKitty. Any code to link the indexer to KyperKitty will need to be installed by hand in the new venv. (This is pretty likely, in fact, since Whoosh is very inefficient and no longer recommended for production.)
My current implementation uses the Python venv installation method. I'd prefer a more container-focused installation, but since I don't believe Mailman 3 has official container images yet, I plan to continue with the venv approach. Please let me know your thoughts.
I take it from your (OP's) preference for containers that you're familiar with them. I'm a Docker newbie, and found the documentation confusing. I think because there are aspects (like use of environment variables in config files) that must have been implemented in Mailman but are not commonly used in plain venv installations. There are a number of comments in the docker-compose.yaml(s) and Dockerfile that are bitrotted, and docker itself emits some deprecation warnings. I'd have to say this is not ready to be promoted to "supported" for those reasons, but they're mostly cosmetic.
FWIW, I do think the implementation itself is detailed and solid. It appears to be getting quite a lot of attention from beta testers, including patches.
The only thing I should warn is that mail routing demands a lot of the network admin. The most common complaints I've seen about the package is that trying to integrate with a larger network of containers gets messy. If Mailman suite is isolated in its own network, it should be straightforward,
Steve
-- GNU Mailman consultant (installation, migration, customization) Sirius Open Source https://www.siriusopensource.com/ Software systems consulting in Europe, North America, and Japan
participants (4)
-
Mark Sapiro -
Ruth Ivimey-Cook -
Stephen Daniel -
Stephen J. Turnbull