how to upgrade proxmox mail gateway from 5.x to 6

5
(1)

First switch PMG to no subscription repo.

in file /etc/apt/sources.list change first line

deb http://download.proxmox.com/debian/pmg buster pmg-no-subscription

Upgrade to the latest version of Proxmox Mail Gateway 5.2.

apt update
apt dist-upgrade

Make a valid and tested backup of Proxmox Mail Gateway, either create and download it from the Webinterface, or do so on the CLI:

pmgbackup backup

At least 1GB free disk space at root mount point.

In-place upgrades are done with apt. Familiarity with apt is required to proceed with this upgrade mechanism.

Please ensure first that your Mail Gateway 5 system is up-to-date before starting the upgrade process.

Update the configured APT repositories

Change the apt sources to Buster 

sed -i 's/stretch/buster/g' /etc/apt/sources.list

Make sure to also edit all files in /etc/apt/sources.list.d/ accordingly.

Stop and Mask Services Before Upgrade

This is necessary to prevent changes to the database before and during the upgrade.

  • Stop postfix and all Proxmox Mail Gateway services (emails will be queued by the servers trying to contact the Proxmox Mail Gateway)
systemctl stop postfix pmg-smtp-filter pmgpolicy pmgdaemon pmgproxy pmgmirror pmgtunnel

Mask postfix and all Proxmox Mailgateway services to prevent them from starting during the upgrade

systemctl mask postfix pmg-smtp-filter pmgpolicy pmgdaemon pmgproxy pmgmirror pmgtunnel

For Clusters

  • If you have a cluster, stop and mask all cluster-daemons on all nodes before you start the upgrade of the first node.
systemctl stop pmgmirror pmgtunnel
systemctl mask pmgmirror pmgtunnel
  • Then proceed by upgrading all nodes sequentially.
  • The mail gateway service is provided by the other nodes, currently not being upgraded.

Upgrade The System

apt update
apt dist-upgrade

It is not necessary to reboot yet.

Upgrade postgres Database

  • Before you upgrade the postgres main cluster, you need to remove the automatically created cluster in the new version.
pg_dropcluster --stop 11 main

Upgrade the postgres main cluster from 9.6 to 11 by using pg_upgradecluster

  • If possible, use the default setting of dumping the old databases and restoring them to avoid problems.
pg_upgradecluster -v 11 9.6 main

If you want to do an in-place upgrade (using pg_upgrade instead of pg_dump and pg_restore), you need to REINDEX all databases due to an incompatibility in glibc:

Unmask postfix and all non-cluster Proxmox Mail Gateway services to enable them again.

systemctl unmask postfix pmg-smtp-filter pmgpolicy pmgdaemon pmgproxy

Reboot and control the journal to ensure that everything runs correctly.

reboot

Remove the old postgres version and its data:

apt purge postgresql-9.6 postgresql-client-9.6 postgresql-contrib-9.6

After upgrading, unmask and start all cluster-daemons on all nodes. This applies to upgrades of a single node as well as to upgrades of all nodes in a clustered setup:

systemctl unmask pmgmirror pmgtunnel
systemctl start pmgmirror pmgtunnel

If you’ve modified the configuration template for postgresql (/var/lib/pmg/templates/postgresql.conf), make sure to compare and update your copy in /etc/pmg/templates/

Also compare all other templates you’ve overriden for new changes through the packages.

Debian Buster installs apparmor, if you still have the Debian stock kernel installed (linux-image-4.19.0-5-amd64 recommends apparmor), due to a mismatch between the apparmor featureset in the stock kernel and the pve-kernel (which Proxmox Mailgateway uses) certain important services (e.g. clamav) do not start. Currently you can mitigate the issue in two ways:

  • uninstall apparmorapt remove apparmor
  • disable feature-pinning in apparmor by commenting out or deleting the line features-file=/usr/share/apparmor-features/features in /etc/apparmor/parser.conf

f you’ve modified /etc/logrotate.d/rsyslog make sure to compare the file upon upgrade – the postrotate script changed. Without the new script logrotation does not work which also breaks the tracking center. The postrotate script needs to be:

/usr/lib/rsyslog/rsyslog-rotate

Similar Posts:

3,258

How useful was this post?

Click on a star to rate it!

Average rating 5 / 5. Vote count: 1

No votes so far! Be the first to rate this post.

Scroll to Top