On 6/21/26 1:47 PM, Steven Jones via Mailman-Users wrote:

How would this be done?  I assume take Mailman2 down for a day or 2, standup 
Mailman3 and migrate the lists but this seems a high risk undertaking.

No.

It is perfectly fine to support both Mailman 2.1 and Mailman 3 on the same server with the same domain(s). The process is install and test Mailman 3 on the server with one or more test lists. After you are convinced that Mailman 3 is OK, migrate the Mailman 2.1 lists.

I've attached `migrate_list` which is the bash script I used to migrate this list and many other MM 2.1 lists to MM 3 on mail.python.org. It has lots of mail.python.org specific stuff in it, but you should be able to modify it for your environment.

The script does one list and it runs fairly quickly, so you can run it without shutting anything down as long as it's at a time when there are no posts to the list, and if you're concerned about arriving posts, you can stop the MTA while running the migration.

--
Mark Sapiro <[email protected]>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan
#!/bin/bash
if [ $# -ne 1 ]; then
    echo "Usage: $0 list_name"
    exit 1
fi
echo 'This script needs to be run as user mailman and only after verifying'
echo "/srv/mailman/archives/private/$1.mbox/$1.mbox"
echo "is good (scripts in /opt/mailman/git/hyperkitty/hyperkitty/contrib/) and"
echo "checking https://mail.python.org/mailman/admindb/$1 for pending requests."
echo "Held messages if any will be backed up."
echo 'Type "Yes" to continue; anything else to quit.'
read -p "> " response
if [ "x$response" != "xYes" ] ; then exit; fi
rsync -a /srv/mailman/lists/$1 /opt/mailman/backup-mm2/ ||\
    { echo rsync failed ; exit 1; }
if [ -n "`find /srv/mailman/data/ -type f -name heldmsg-$1-\[0-9\]\*.pck`" ]; 
then
    echo Backing up held messages
    for msg in `find /srv/mailman/data/ -type f -name heldmsg-$1-\[0-9\]\*.pck` 
; do
      rsync $msg /opt/mailman/backup-mm2/$1/ ; done ||\
        { echo held message backup failed ; exit 1; }
fi
cd /opt/mailman/backup-mm2/$1
/opt/mailman/mm/bin/mailman create [email protected] > create.ot ||\
    { echo create failed ; exit 1; }
echo MM3 list [email protected] created.
/opt/mailman/mm/bin/mailman import21 [email protected] \
    /opt/mailman/backup-mm2/$1/config.pck > import21.ot ||\
    { echo import21 failed ; exit 1; }
echo MM2 config imported.
/srv/mailman/bin/rmlist $1 || { echo rmlist failed ; exit 1; }
echo MM 2 list removed.
if [ -f /opt/mailman/backup-mm2/$1/digest.mbox ] ; then
    echo moving digest.mbox.
    /opt/mailman/move_digest $1
fi
if [ -f /srv/mailman/archives/private/$1.mbox/$1.mbox ] ; then
/opt/mailman/mm/bin/mailman-web-django-admin hyperkitty_import -l 
[email protected]\
    --no-sync-mailman \
    /srv/mailman/archives/private/$1.mbox/$1.mbox > hkimport.ot 2> hk_error||\
    { echo hk_import failed ; exit 1; }
if [ -s hk_error ] ; then echo Check hk_error; fi
echo Archives imported with --no-sync-mailman.  Run
echo     django-admin mailman_sync
echo "but if doing multiple lists, it's only needed after the last one."
fi
echo Check these templates for edit or removal
find /opt/mailman/mm/var/templates/lists/$1.python.org -type f
echo
echo Add these lines to /etc/apache2/sites-enabled/mail.python.org-ssl.conf
echo "        RedirectMatch permanent /mailman/listinfo/$1(/.*)?\$ \\"
echo "         https://mail.python.org/mailman3/lists/$1.python.org/";
if [ ! -d /srv/mailman/archives/public/$1 ] ; then exit; fi
echo
echo "The old archive is public, so add these lines to"
echo "/srv/mailman/archives/private/$1/index.html"
echo "     <p>"
echo "       This list has been migrated to Mailman 3. This archive is not 
being"
echo "       updated."
echo "       <a 
href=\"https://mail.python.org/archives/list/[email protected]/\";>"
echo "       Here is the new archive including these old posts</a>."
echo "      </p>"
------------------------------------------------------
Mailman-Users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/mailman-users.python.org/
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: https://www.mail-archive.com/[email protected]/
    https://mail.python.org/archives/list/[email protected]/
Member address: [email protected]

Reply via email to