#!/bin/bash s=$1 test -z "$s" && echo 'Specify the list FQDN to migrate!' && exit 1 echo "*** starting at $(date -Is) ***" set -x for m in $( ls -d /var/lib/mailman/import/$s/lists/* \ | grep -v /mailman$ \ | cut -d/ -f8 ); do time sudo docker-compose -f /etc/mailman-compose/docker-compose.yaml \ exec -T -u mailman mailman-core mailman import21 $m@$s \ /opt/import/$s/lists/$m/config.pck time sudo docker-compose -f /etc/mailman-compose/docker-compose.yaml \ exec -T -u mailman mailman-web python3 manage.py hyperkitty_import -l \ $m@$s /opt/import/$s/archives/private/$m.mbox/$m.mbox time sudo docker-compose -f /etc/mailman-compose/docker-compose.yaml \ exec -T -u mailman mailman-web python3 manage.py \ update_index_one_list $m@$s done sudo mv /var/lib/mailman/import/$s/archives \ /var/lib/mailman/web-data/mm2archives/$s for a in /var/lib/mailman/web-data/mm2archives/$s/public/*; do sudo ln -fs ../private/`basename $a` $a done set +x echo "*** completed at $(date -Is) ***"