Difference between revisions of "Upgrade from 5.x to 6.0"

From Proxmox Mail Gateway
Jump to navigation Jump to search
m (change indentation level of headings, move all one out.)
Line 1: Line 1:
== Introduction ==
+
= Introduction =
 
Proxmox Mail Gateway 6.x is based on a new major version of Debian. Carefully plan the upgrade, '''make and verify backups''' before beginning, and test extensively. Depending on the existing configuration, several manual steps — including some downtime — may be required.
 
Proxmox Mail Gateway 6.x is based on a new major version of Debian. Carefully plan the upgrade, '''make and verify backups''' before beginning, and test extensively. Depending on the existing configuration, several manual steps — including some downtime — may be required.
  
Line 13: Line 13:
 
In both cases emptying the browser cache and reloading the GUI page is required after the upgrade.
 
In both cases emptying the browser cache and reloading the GUI page is required after the upgrade.
  
== New Installation ==
+
= New Installation =
 
* Install Proxmox Mail Gateway in one of the following three ways:
 
* Install Proxmox Mail Gateway in one of the following three ways:
 
** As a [https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#_install_proxmox_mail_gateway_as_linux_container_appliance container on top of Debian Buster]
 
** As a [https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#_install_proxmox_mail_gateway_as_linux_container_appliance container on top of Debian Buster]
Line 24: Line 24:
 
** then join them to the upgraded master-node (recreate the cluster).
 
** then join them to the upgraded master-node (recreate the cluster).
  
== In-place Upgrade ==
+
= In-place Upgrade =
=== Preconditions ===
+
== Preconditions ==
  
 
* Upgrade to the latest version of Proxmox Mail Gateway 5.2.
 
* Upgrade to the latest version of Proxmox Mail Gateway 5.2.
Line 38: Line 38:
 
In-place upgrades are done with apt. '''Familiarity with apt is required to proceed with this upgrade mechanism. '''
 
In-place upgrades are done with apt. '''Familiarity with apt is required to proceed with this upgrade mechanism. '''
  
=== Actions step-by-step ===
+
== Actions step-by-step ==
 
* Change the apt sources to Buster - see [https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#pmg_package_repositories Package Repositories]
 
* Change the apt sources to Buster - see [https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#pmg_package_repositories Package Repositories]
 
  sed -i 's/stretch/buster/g' /etc/apt/sources.list
 
  sed -i 's/stretch/buster/g' /etc/apt/sources.list
Line 80: Line 80:
 
  apt purge postgresql-9.6 postgresql-client-9.6 postgresql-contrib-9.6
 
  apt purge postgresql-9.6 postgresql-client-9.6 postgresql-contrib-9.6
  
=== After the Proxmox Mail Gateway upgrade ===
+
== After the Proxmox Mail Gateway upgrade ==
 
* After upgrading, unmask and start all cluster-daemons. This applies to upgrades of a single node as well as to upgrades of all nodes in a clustered setup:
 
* After upgrading, unmask and start all cluster-daemons. 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 unmask pmgmirror pmgtunnel
 
  systemctl start pmgmirror pmgtunnel
 
  systemctl start pmgmirror pmgtunnel
  
== Potential issues ==
+
= Potential issues =
  
 
* If you've modified the configuration template for postgresql (<code>/var/lib/pmg/templates/postgresql.conf</code>), make sure to compare and update your copy in <code>/etc/pmg/templates/</code>
 
* If you've modified the configuration template for postgresql (<code>/var/lib/pmg/templates/postgresql.conf</code>), make sure to compare and update your copy in <code>/etc/pmg/templates/</code>
Line 93: Line 93:
 
* Clamav-freshclam has a bug with it's AppArmor handling, which seems not fixed yet: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=903834
 
* Clamav-freshclam has a bug with it's AppArmor handling, which seems not fixed yet: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=903834
  
== External links ==
+
= External links =
  
 
*[https://www.debian.org/releases/buster/amd64/release-notes/ Release Notes for Debian 10.0 (buster), 64-bit PC]
 
*[https://www.debian.org/releases/buster/amd64/release-notes/ Release Notes for Debian 10.0 (buster), 64-bit PC]

Revision as of 13:52, 20 August 2019

Introduction

Proxmox Mail Gateway 6.x is based on a new major version of Debian. Carefully plan the upgrade, make and verify backups before beginning, and test extensively. Depending on the existing configuration, several manual steps — including some downtime — may be required.

Note: A valid and tested backup is always needed before starting the upgrade process. Test the backup beforehand in a test lab setup.

In case the system is customized and/or uses additional packages or any other third party repositories/packages, ensure those packages are also upgraded to and compatible with Debian Buster.

In general, there are two ways to upgrade a Proxmox Mail Gateway 5.x system to Proxmox Mail Gateway 6.x:

  • A new installation (and restoring the configuration and database from the backup)
  • An in-place upgrade via apt (step-by-step)

In both cases emptying the browser cache and reloading the GUI page is required after the upgrade.

New Installation

  • Install Proxmox Mail Gateway in one of the following three ways:
  • Restore the backup you have made before the upgrade.
  • Change the IP address and the hostname.
  • For clustered setups:
    • setup the slaves again
    • then join them to the upgraded master-node (recreate the cluster).

In-place Upgrade

Preconditions

  • 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
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.

Actions step-by-step

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

Make sure to also edit all files in /etc/apt/sources.list.d/ accordingly. For a Installation from the ISO with the enterprise repository the following command will work:

echo "deb https://enterprise.proxmox.com/debian/pmg buster pmg-enterprise" > /etc/apt/sources.list.d/pmg-enterprise.list
  • Stop postfix and all Proxmox Mail Gateway services (emails will be queued by the servers trying to contact the Proxmox Mail Gateway)

This is necessary to prevent changes to the database before the upgrade

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 
  • 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 service is provided by the nodes not being upgraded.
  • Upgrade the system:
apt update
apt dist-upgrade
  • 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
  • Unmask postfix and all non-cluster Proxmox MG 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 the Proxmox Mail Gateway upgrade

  • After upgrading, unmask and start all cluster-daemons. 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

Potential issues

  • 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

External links