<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://pmg.proxmox.com/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=L.Leahu-Vladucu</id>
	<title>Proxmox Mail Gateway - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://pmg.proxmox.com/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=L.Leahu-Vladucu"/>
	<link rel="alternate" type="text/html" href="https://pmg.proxmox.com/wiki/Special:Contributions/L.Leahu-Vladucu"/>
	<updated>2026-06-09T04:45:25Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://pmg.proxmox.com/mediawiki/index.php?title=Upgrade_from_6.x_to_7.0&amp;diff=165</id>
		<title>Upgrade from 6.x to 7.0</title>
		<link rel="alternate" type="text/html" href="https://pmg.proxmox.com/mediawiki/index.php?title=Upgrade_from_6.x_to_7.0&amp;diff=165"/>
		<updated>2026-06-08T06:38:37Z</updated>

		<summary type="html">&lt;p&gt;L.Leahu-Vladucu: Consistently mention apt instead of apt-get for newer releases&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
Proxmox Mail Gateway 7.x is based on the new major version of Debian (Bullseye). Carefully plan the upgrade, &#039;&#039;&#039;make and verify backups&#039;&#039;&#039; before beginning, and test extensively. Depending on the existing configuration, several manual steps — including some downtime — may be required.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; A valid and tested backup is &#039;&#039;always&#039;&#039; required, before starting the upgrade process. Test the backup beforehand in a test lab setup.&lt;br /&gt;
&lt;br /&gt;
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 Bullseye.&lt;br /&gt;
&lt;br /&gt;
In general, there are two ways to upgrade a Proxmox Mail Gateway 6.x system to Proxmox Mail Gateway 7.0:&lt;br /&gt;
&lt;br /&gt;
* A new installation (restoring the configuration and database from the backup)&lt;br /&gt;
* An in-place upgrade via apt (step-by-step)&lt;br /&gt;
&lt;br /&gt;
In both cases, emptying the browser cache and reloading the GUI is required after the upgrade.&lt;br /&gt;
&lt;br /&gt;
= New Installation =&lt;br /&gt;
&lt;br /&gt;
* Install Proxmox Mail Gateway in one of the following three ways:&lt;br /&gt;
** As a [https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#pmg_install_on_debian_container container on top of Debian Bullseye]&lt;br /&gt;
** [https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#pmg_install_on_debian On top of Debian Bullseye]&lt;br /&gt;
** By using the [https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#pmg_install_iso ISO image]&lt;br /&gt;
* Restore the backup which you made before the upgrade.&lt;br /&gt;
* Change the IP address and hostname.&lt;br /&gt;
* For &#039;&#039;&#039;clustered setups&#039;&#039;&#039;: &lt;br /&gt;
** On the master, remove all nodes from the cluster&lt;br /&gt;
** Upgrade the master&lt;br /&gt;
** Set the nodes up fresh, then join them to the upgraded master-node (recreate the cluster).&lt;br /&gt;
&lt;br /&gt;
= In-Place Upgrade =&lt;br /&gt;
== Preconditions ==&lt;br /&gt;
&lt;br /&gt;
The following actions need to be carried out from the command line.&lt;br /&gt;
&lt;br /&gt;
Perform the actions via console or SSH. If you use SSH you should use a terminal multiplexer (for example, tmux or screen) to ensure the upgrade can continue even if the SSH connection gets interrupted.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do not carry out the upgrade via the web-interface (GUI) console, as that will get interrupted during the upgrade!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Old releases must use [https://forum.proxmox.com/threads/new-archive-cdn-for-end-of-life-eol-releases.178957/ the archive CDN for Proxmox] and [https://www.debian.org/distrib/archive for Debian], so make sure that all repositories in &amp;lt;code&amp;gt;/etc/apt/sources.list&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/etc/apt/sources.list.d/*.list&amp;lt;/code&amp;gt; use:&lt;br /&gt;
* &amp;lt;code&amp;gt;archive.debian.org&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;*.debian.org&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;archive.proxmox.com&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;*.proxmox.com&amp;lt;/code&amp;gt;&lt;br /&gt;
* In case certificate errors occur while running &amp;lt;code&amp;gt;apt update&amp;lt;/code&amp;gt;, use HTTP instead of HTTPS for the repositories.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Upgrade to the latest version of Proxmox Mail Gateway 6.4 first.&lt;br /&gt;
*:&amp;lt;pre&amp;gt;&lt;br /&gt;
*::apt update&lt;br /&gt;
*::apt dist-upgrade&lt;br /&gt;
*:&amp;lt;/pre&amp;gt;&lt;br /&gt;
*: You can check the web-interface (reload) at the top, or use &amp;lt;code&amp;gt;pmgversion&amp;lt;/code&amp;gt;. Both must show a version with 6.4-4 (or newer), for example something like &amp;lt;code&amp;gt;pmg-api/6.4-4/...&amp;lt;/code&amp;gt; for the CLI command.&lt;br /&gt;
*: If you still see an older version, you should ensure that you have valid [https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#pmg_package_repositories package repositories] configured.&lt;br /&gt;
* Make a valid and tested backup of Proxmox Mail Gateway.&lt;br /&gt;
*: You can either create and download one from the web-interface, store it on your Proxmox Backup Server or create it from the CLI with &amp;lt;code&amp;gt;pmgbackup backup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* At least 4 GiB free disk space on root mount point.&lt;br /&gt;
* Check [[Upgrade_from_6.x_to_7.0#Potential_issues|known upgrade issues]]&lt;br /&gt;
&lt;br /&gt;
In-place upgrades are carried out using APT. &#039;&#039;&#039;Familiarity with APT is required to proceed with this upgrade mechanism. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Actions step-by-step ==&lt;br /&gt;
&lt;br /&gt;
Please first ensure that your Mail Gateway 6 system is up-to-date and that a valid backup has been created before starting the upgrade process.&lt;br /&gt;
If you need to adapt the configuration, do this now. In case you have a cluster, wait for all config-changes to be synced to all nodes before continuing.&lt;br /&gt;
&lt;br /&gt;
=== For clusters ===&lt;br /&gt;
* If you have a &#039;&#039;&#039;cluster&#039;&#039;&#039;, stop and mask all cluster-daemons &#039;&#039;&#039;on all nodes&#039;&#039;&#039; before you start the upgrade of the first node.&lt;br /&gt;
*:&amp;lt;pre&amp;gt;&lt;br /&gt;
*:: systemctl stop pmgmirror pmgtunnel&lt;br /&gt;
*:: systemctl mask pmgmirror pmgtunnel&lt;br /&gt;
*:&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Then proceed by upgrading all nodes sequentially.&lt;br /&gt;
* The Mail Gateway service will be provided by the other nodes, which aren&#039;t currently being upgraded.&lt;br /&gt;
* Certain operations (for example config changes) will only work once all nodes have been upgraded.&lt;br /&gt;
&lt;br /&gt;
=== Update the configured APT repositories ===&lt;br /&gt;
Change the apt sources to Bullseye - see [https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#pmg_package_repositories Package Repositories]&lt;br /&gt;
Update all Debian repository entries to Bullseye.&lt;br /&gt;
&lt;br /&gt;
 sed -i &#039;s/buster\/updates/bullseye-security/g;s/buster/bullseye/g&#039; /etc/apt/sources.list&lt;br /&gt;
&lt;br /&gt;
Note that for Bullseye, Debian changed its security update repository from &amp;lt;code&amp;gt;deb http://security.debian.org buster/updates main&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;deb http://security.debian.org bullseye-security main&amp;lt;/code&amp;gt; for more consistency.&lt;br /&gt;
The above command accounts for this change already.&lt;br /&gt;
&lt;br /&gt;
Update the enterprise repository to Bullseye:&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;deb https://enterprise.proxmox.com/debian/pmg bullseye pmg-enterprise&amp;quot; &amp;gt; /etc/apt/sources.list.d/pmg-enterprise.list&lt;br /&gt;
&lt;br /&gt;
Make sure to also update any extra files that you added to &amp;lt;code&amp;gt;/etc/apt/sources.list.d/&amp;lt;/code&amp;gt; to Bullseye accordingly.&lt;br /&gt;
&lt;br /&gt;
In case [https://forum.proxmox.com/threads/new-archive-cdn-for-end-of-life-eol-releases.178957/ the archive CDN for Proxmox] and [https://www.debian.org/distrib/archive for Debian] have been used, please switch back to the normal [https://pve.proxmox.com/wiki/Package_Repositories Package Repositories].&lt;br /&gt;
 &lt;br /&gt;
=== Stop and mask services before upgrade ===&lt;br /&gt;
&lt;br /&gt;
This is necessary to prevent changes to the database before and during the upgrade.&lt;br /&gt;
&lt;br /&gt;
* Stop postfix and all Proxmox Mail Gateway services (emails will be queued by the servers trying to contact the Proxmox Mail Gateway)&lt;br /&gt;
:&amp;lt;pre&amp;gt;systemctl stop postfix pmg-smtp-filter pmgpolicy pmgdaemon pmgproxy pmgmirror pmgtunnel&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Mask postfix and all Proxmox Mailgateway services to prevent them from starting during the upgrade:&lt;br /&gt;
:&amp;lt;pre&amp;gt;systemctl mask postfix pmg-smtp-filter pmgpolicy pmgdaemon pmgproxy pmgmirror pmgtunnel&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Upgrade the system ===&lt;br /&gt;
&lt;br /&gt;
 apt update&lt;br /&gt;
 apt dist-upgrade&lt;br /&gt;
&lt;br /&gt;
It is not necessary to reboot yet.&lt;br /&gt;
&lt;br /&gt;
=== Upgrade the PostgreSQL database ===&lt;br /&gt;
&lt;br /&gt;
* Before upgrading the PostgreSQL main cluster, you need to remove the automatically created cluster in the new version.&lt;br /&gt;
:&amp;lt;pre&amp;gt;pg_dropcluster --stop 13 main&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Upgrade the PostgreSQL main cluster from 11 to 13, using &amp;lt;code&amp;gt;pg_upgradecluster&amp;lt;/code&amp;gt;&lt;br /&gt;
** This step will need some &#039;&#039;&#039;time&#039;&#039;&#039; and enough &#039;&#039;&#039;free diskspace&#039;&#039;&#039; as it will create another database containing your rules, statistics, and quarantine information.&lt;br /&gt;
** If possible, use the default setting of dumping the old databases and restoring them, to avoid problems.&lt;br /&gt;
:&amp;lt;pre&amp;gt;pg_upgradecluster -v 13 11 main&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Unmask postfix and all &#039;&#039;&#039;non-cluster&#039;&#039;&#039; Proxmox Mail Gateway services to enable them again.&lt;br /&gt;
:&amp;lt;pre&amp;gt;systemctl unmask postfix pmg-smtp-filter pmgpolicy pmgdaemon pmgproxy&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Reboot and then check the journal to ensure that everything is running correctly again.&lt;br /&gt;
:&amp;lt;pre&amp;gt;reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Reconnect to the node after it successfully rebooted&lt;br /&gt;
&lt;br /&gt;
* You can remove the old PostgreSQL version and its data now, if all is working as expected:&lt;br /&gt;
:&amp;lt;pre&amp;gt;apt purge postgresql-11 postgresql-client-11&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== After the Proxmox Mail Gateway upgrade ==&lt;br /&gt;
&lt;br /&gt;
After upgrading, unmask and start all cluster-daemons on &#039;&#039;&#039;all nodes&#039;&#039;&#039;. This applies to upgrades of a single node, as well as to upgrades of all nodes in a clustered setup:&lt;br /&gt;
 systemctl unmask pmgmirror pmgtunnel&lt;br /&gt;
 systemctl start pmgmirror pmgtunnel&lt;br /&gt;
&lt;br /&gt;
= Known issues and deprecations =&lt;br /&gt;
&lt;br /&gt;
* New default bind address for pmgproxy, unifying the default behavior with Proxmox Backup Server and Proxmox VE&lt;br /&gt;
** In making the LISTEN_IP configurable, the daemon now binds to both wildcard addresses (IPv4 &amp;lt;code&amp;gt;0.0.0.0:8006&amp;lt;/code&amp;gt; and IPv6 &amp;lt;code&amp;gt;[::]:8006&amp;lt;/code&amp;gt;) by default.&lt;br /&gt;
*: Should you wish to prevent it from listening on IPv6, simply configure the IPv4 wildcard as LISTEN_IP in &amp;lt;code&amp;gt;/etc/default/pmgproxy&amp;lt;/code&amp;gt;:&lt;br /&gt;
*: &amp;lt;code&amp;gt;LISTEN_IP=&amp;quot;0.0.0.0&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
** Additionally, the logged IP address format changed for IPv4 in pmgproxy&#039;s access log (&amp;lt;code&amp;gt;/var/log/pmgproxy/pmgproxy.log&amp;lt;/code&amp;gt;). They are now logged as IPv4-mapped IPv6 addresses, so instead of:&lt;br /&gt;
*: &amp;lt;code&amp;gt;192.168.16.68 - root@pam [10/04/2021:12:35:11 +0200] &amp;quot;GET /api2/json/config/ruledb/digest HTTP/1.1&amp;quot; 200 51&amp;lt;/code&amp;gt;&lt;br /&gt;
*: the line now looks like:&lt;br /&gt;
*: &amp;lt;code&amp;gt;::ffff:192.168.16.68 - root@pam [10/04/2021:12:35:11 +0200] &amp;quot;GET /api2/json/config/ruledb/digest HTTP/1.1&amp;quot; 200 51&amp;lt;/code&amp;gt;&lt;br /&gt;
*:If you want to restore the old logging format, also set &amp;lt;code&amp;gt;LISTEN_IP=&amp;quot;0.0.0.0&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The ClamAV SafeBrowsing feature has [https://blog.clamav.net/2021/04/are-you-still-attempting-to-download.html been deprecated upstream some time ago]&lt;br /&gt;
** The config option in &amp;lt;code&amp;gt;pmg.conf&amp;lt;/code&amp;gt; is now considered deprecated and will be dropped with PMG 8.0.&lt;br /&gt;
** The configuration template &amp;lt;code&amp;gt;freshclam.conf.in&amp;lt;/code&amp;gt; has the relevant sections removed (rendering the configuration option useless).&lt;br /&gt;
** If you&#039;ve set the option (&amp;lt;code&amp;gt;grep safebrowsing /etc/pmg/pmg.conf&amp;lt;/code&amp;gt; produces output) - please remove it.&lt;br /&gt;
&lt;br /&gt;
= Potential issues =&lt;br /&gt;
&lt;br /&gt;
== General ==&lt;br /&gt;
&lt;br /&gt;
As a Debian based Distribution, Proxmox Mail Gateway is affected by most issues and changes affecting Debian.&lt;br /&gt;
Thus, ensure to read the [https://www.debian.org/releases/bullseye/amd64/release-notes/ch-information.en.html upgrade specific issues for Bullseye].&lt;br /&gt;
&lt;br /&gt;
== Installations as Container on Proxmox VE ==&lt;br /&gt;
&lt;br /&gt;
The newer version of &amp;lt;code&amp;gt;systemd&amp;lt;/code&amp;gt; inside the container requires that the &amp;lt;code&amp;gt;nesting&amp;lt;/code&amp;gt; feature has to be enabled for the container.&lt;br /&gt;
This is needed in order for many essential services to be able to run.&lt;br /&gt;
Keep in mind that this makes running privileged containers an even greater risk, thus it is recommended to only use unprivileged containers.&lt;br /&gt;
&lt;br /&gt;
== non-usr-merged layouts ==&lt;br /&gt;
Most Proxmox Mail Gateway installations still have /bin and /usr/bin as separate directories - this is deprecated as of Debian Bullseye/11 and will become unsupported in Debian Bookworm/12.&lt;br /&gt;
&lt;br /&gt;
See [https://www.debian.org/releases/bullseye/amd64/release-notes/ch-information.en.html#deprecated-components Deprecated Components] for migration instructions.&lt;br /&gt;
&lt;br /&gt;
Usually creating a backup of the system and installing the &amp;lt;code&amp;gt;usrmerge&amp;lt;/code&amp;gt; package is all that is needed.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
[https://www.debian.org/releases/bullseye/amd64/release-notes/ Release Notes for Debian 11.0 (bullseye), 64-bit PC]&lt;br /&gt;
&lt;br /&gt;
[[Category: Upgrade]]&lt;/div&gt;</summary>
		<author><name>L.Leahu-Vladucu</name></author>
	</entry>
	<entry>
		<id>https://pmg.proxmox.com/mediawiki/index.php?title=Upgrade_from_5.x_to_6.0&amp;diff=164</id>
		<title>Upgrade from 5.x to 6.0</title>
		<link rel="alternate" type="text/html" href="https://pmg.proxmox.com/mediawiki/index.php?title=Upgrade_from_5.x_to_6.0&amp;diff=164"/>
		<updated>2026-06-08T06:37:34Z</updated>

		<summary type="html">&lt;p&gt;L.Leahu-Vladucu: Consistently mention apt instead of apt-get for newer releases&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
Proxmox Mail Gateway 6.x is based on a new major version of Debian. Carefully plan the upgrade, &#039;&#039;&#039;make and verify backups&#039;&#039;&#039; before beginning, and test extensively. Depending on the existing configuration, several manual steps — including some downtime — may be required.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; A valid and tested backup is &#039;&#039;always&#039;&#039; needed before starting the upgrade process. Test the backup beforehand in a test lab setup.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
In general, there are two ways to upgrade a Proxmox Mail Gateway 5.x system to Proxmox Mail Gateway 6.x:&lt;br /&gt;
&lt;br /&gt;
*A new installation (and restoring the configuration and database from the backup)&lt;br /&gt;
*An in-place upgrade via apt (step-by-step)&lt;br /&gt;
&lt;br /&gt;
In both cases emptying the browser cache and reloading the GUI page is required after the upgrade.&lt;br /&gt;
&lt;br /&gt;
= New Installation =&lt;br /&gt;
* Install Proxmox Mail Gateway in one of the following three ways:&lt;br /&gt;
** 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]&lt;br /&gt;
** [https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#_install_proxmox_mail_gateway_on_debian On top of Debian Buster]&lt;br /&gt;
** By using the [https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#_using_the_proxmox_mail_gateway_installation_cd_rom ISO image]&lt;br /&gt;
* Restore the backup you have made before the upgrade.&lt;br /&gt;
* Change the IP address and the hostname.&lt;br /&gt;
* For &#039;&#039;&#039;clustered setups&#039;&#039;&#039;: &lt;br /&gt;
** setup the slaves again&lt;br /&gt;
** then join them to the upgraded master-node (recreate the cluster).&lt;br /&gt;
&lt;br /&gt;
= In-place Upgrade =&lt;br /&gt;
== Preconditions ==&lt;br /&gt;
&lt;br /&gt;
Old releases must use [https://forum.proxmox.com/threads/new-archive-cdn-for-end-of-life-eol-releases.178957/ the archive CDN for Proxmox] and [https://www.debian.org/distrib/archive for Debian], so make sure that all repositories in &amp;lt;code&amp;gt;/etc/apt/sources.list&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/etc/apt/sources.list.d/*.list&amp;lt;/code&amp;gt; use:&lt;br /&gt;
* &amp;lt;code&amp;gt;archive.debian.org&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;*.debian.org&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;archive.proxmox.com&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;*.proxmox.com&amp;lt;/code&amp;gt;&lt;br /&gt;
* In case certificate errors occur while running &amp;lt;code&amp;gt;apt update&amp;lt;/code&amp;gt;, use HTTP instead of HTTPS for the repositories.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Upgrade to the latest version of Proxmox Mail Gateway 5.2.&lt;br /&gt;
 apt update&lt;br /&gt;
 apt dist-upgrade&lt;br /&gt;
&lt;br /&gt;
* Make a valid and tested backup of Proxmox Mail Gateway, either create and download it from the Webinterface, or do so on the CLI:&lt;br /&gt;
 pmgbackup backup&lt;br /&gt;
&lt;br /&gt;
* At least 1GB free disk space at root mount point.&lt;br /&gt;
* Check [[Upgrade_from_5.x_to_6.0#Potential_issues|known upgrade issues]]&lt;br /&gt;
&lt;br /&gt;
In-place upgrades are done with apt. &#039;&#039;&#039;Familiarity with apt is required to proceed with this upgrade mechanism. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Actions step-by-step ==&lt;br /&gt;
&lt;br /&gt;
Please ensure first that your Mail Gateway 5 system is up-to-date before starting the upgrade process.&lt;br /&gt;
&lt;br /&gt;
=== Update the configured APT repositories ===&lt;br /&gt;
&lt;br /&gt;
Change the apt sources to Buster - see [https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#pmg_package_repositories Package Repositories]&lt;br /&gt;
 sed -i &#039;s/stretch/buster/g&#039; /etc/apt/sources.list&lt;br /&gt;
&lt;br /&gt;
Make sure to also edit all files in &amp;lt;code&amp;gt;/etc/apt/sources.list.d/&amp;lt;/code&amp;gt; accordingly. For a Installation from the ISO&lt;br /&gt;
with the enterprise repository the following command will work:&lt;br /&gt;
 echo &amp;quot;deb http://archive.proxmox.com/debian/pmg buster pmg-enterprise&amp;quot; &amp;gt; /etc/apt/sources.list.d/pmg-enterprise.list&lt;br /&gt;
&lt;br /&gt;
=== Stop and Mask Services Before Upgrade ===&lt;br /&gt;
&lt;br /&gt;
This is necessary to prevent changes to the database before and during the upgrade.&lt;br /&gt;
&lt;br /&gt;
* Stop postfix and all Proxmox Mail Gateway services (emails will be queued by the servers trying to contact the Proxmox Mail Gateway)&lt;br /&gt;
 systemctl stop postfix pmg-smtp-filter pmgpolicy pmgdaemon pmgproxy pmgmirror pmgtunnel&lt;br /&gt;
* Mask postfix and all Proxmox Mailgateway services to prevent them from starting during the upgrade&lt;br /&gt;
 systemctl mask postfix pmg-smtp-filter pmgpolicy pmgdaemon pmgproxy pmgmirror pmgtunnel&lt;br /&gt;
&lt;br /&gt;
=== For Clusters ===&lt;br /&gt;
&lt;br /&gt;
* If you have a &#039;&#039;&#039;cluster&#039;&#039;&#039;, stop and mask all cluster-daemons &#039;&#039;&#039;on all nodes&#039;&#039;&#039; before you start the upgrade of the first node.&lt;br /&gt;
 systemctl stop pmgmirror pmgtunnel&lt;br /&gt;
 systemctl mask pmgmirror pmgtunnel&lt;br /&gt;
* Then proceed by upgrading all nodes sequentially.&lt;br /&gt;
* The mail gateway service is provided by the other nodes, currently not being upgraded.&lt;br /&gt;
* Certain operations (for example config changes) will only work once all nodes have been upgraded.&lt;br /&gt;
&lt;br /&gt;
=== Upgrade The System ===&lt;br /&gt;
&lt;br /&gt;
 apt update&lt;br /&gt;
 apt dist-upgrade&lt;br /&gt;
&lt;br /&gt;
It is not necessary to reboot yet.&lt;br /&gt;
&lt;br /&gt;
=== Upgrade postgres Database ===&lt;br /&gt;
&lt;br /&gt;
* Before you upgrade the postgres main cluster, you need to remove the automatically created cluster in the new version.&lt;br /&gt;
 pg_dropcluster --stop 11 main&lt;br /&gt;
* Upgrade the postgres main cluster from 9.6 to 11 by using &amp;lt;code&amp;gt;pg_upgradecluster&amp;lt;/code&amp;gt;&lt;br /&gt;
** If possible, use the default setting of dumping the old databases and restoring them to avoid problems.&lt;br /&gt;
 pg_upgradecluster -v 11 9.6 main&lt;br /&gt;
* If you want to do an in-place upgrade (using &amp;lt;code&amp;gt;pg_upgrade&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;pg_dump&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;pg_restore&amp;lt;/code&amp;gt;), you need to &amp;lt;code&amp;gt;REINDEX&amp;lt;/code&amp;gt; all databases due to an incompatibility in glibc:&lt;br /&gt;
** https://postgresql.verite.pro/blog/2018/08/27/glibc-upgrade.html&lt;br /&gt;
** https://lists.debian.org/debian-glibc/2019/03/msg00030.html&lt;br /&gt;
** https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=927129&lt;br /&gt;
&lt;br /&gt;
* Unmask postfix and all &#039;&#039;&#039;non-cluster&#039;&#039;&#039; Proxmox Mail Gateway services to enable them again.&lt;br /&gt;
 systemctl unmask postfix pmg-smtp-filter pmgpolicy pmgdaemon pmgproxy&lt;br /&gt;
* Reboot and control the journal to ensure that everything runs correctly.&lt;br /&gt;
&lt;br /&gt;
 reboot&lt;br /&gt;
&lt;br /&gt;
* Remove the old postgres version and its data:&lt;br /&gt;
 apt purge postgresql-9.6 postgresql-client-9.6 postgresql-contrib-9.6&lt;br /&gt;
&lt;br /&gt;
== After the Proxmox Mail Gateway upgrade ==&lt;br /&gt;
&lt;br /&gt;
After upgrading, unmask and start all cluster-daemons on &#039;&#039;&#039;all nodes&#039;&#039;&#039;. This applies to upgrades of a single node as well as to upgrades of all nodes in a clustered setup:&lt;br /&gt;
 systemctl unmask pmgmirror pmgtunnel&lt;br /&gt;
 systemctl start pmgmirror pmgtunnel&lt;br /&gt;
&lt;br /&gt;
= Potential issues =&lt;br /&gt;
&lt;br /&gt;
== General ==&lt;br /&gt;
&lt;br /&gt;
As a Debian based Distribution, Proxmox Mail Gateway is affected by most issues and changes affecting Debian.&lt;br /&gt;
So ensure to read the [https://www.debian.org/releases/buster/amd64/release-notes/ch-information.en.html Upgrade specific issues for buster]&lt;br /&gt;
&lt;br /&gt;
Especially the [https://www.debian.org/releases/buster/amd64/release-notes/ch-information.en.html#openssl-defaults OpenSSL default version and security level raised] and [https://www.debian.org/releases/buster/amd64/release-notes/ch-information.en.html#su-environment-variables Semantics for using environment variables for su changed]&lt;br /&gt;
&lt;br /&gt;
== Postgres And Other Template Modifications ==&lt;br /&gt;
If you&#039;ve modified the configuration template for postgresql (&amp;lt;code&amp;gt;/var/lib/pmg/templates/postgresql.conf&amp;lt;/code&amp;gt;), make sure to compare and update your copy in &amp;lt;code&amp;gt;/etc/pmg/templates/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also compare all other templates you&#039;ve overriden for new changes through the packages.&lt;br /&gt;
&lt;br /&gt;
== Service Failure Caused By Apparmor Featureset Missmatch ==&lt;br /&gt;
Debian Buster installs apparmor, if you still have the Debian stock kernel installed (&amp;lt;code&amp;gt;linux-image-4.19.0-5-amd64&amp;lt;/code&amp;gt; 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. &amp;lt;code&amp;gt;clamav&amp;lt;/code&amp;gt;) do not start. Currently you can mitigate the issue in two ways:&lt;br /&gt;
* preferred: uninstall &amp;lt;code&amp;gt;apparmor&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;apt remove apparmor&amp;lt;/code&amp;gt;&lt;br /&gt;
* disable feature-pinning in apparmor by commenting out or deleting the line &amp;lt;code&amp;gt;features-file=/usr/share/apparmor-features/features&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;/etc/apparmor/parser.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Logrotation (rsyslog) ==&lt;br /&gt;
If you&#039;ve modified &amp;lt;code&amp;gt;/etc/logrotate.d/rsyslog&amp;lt;/code&amp;gt; make sure to compare the file upon upgrade - the &amp;lt;code&amp;gt;postrotate&amp;lt;/code&amp;gt; script changed. Without the new script logrotation does not work which also breaks the tracking center. The &amp;lt;code&amp;gt;postrotate&amp;lt;/code&amp;gt; script needs to be:&lt;br /&gt;
 /usr/lib/rsyslog/rsyslog-rotate&lt;br /&gt;
&lt;br /&gt;
= External links =&lt;br /&gt;
&lt;br /&gt;
*[https://www.debian.org/releases/buster/amd64/release-notes/ Release Notes for Debian 10.0 (buster), 64-bit PC]&lt;br /&gt;
&lt;br /&gt;
[[Category: Upgrade]]&lt;/div&gt;</summary>
		<author><name>L.Leahu-Vladucu</name></author>
	</entry>
	<entry>
		<id>https://pmg.proxmox.com/mediawiki/index.php?title=Upgrade_from_6.x_to_7.0&amp;diff=163</id>
		<title>Upgrade from 6.x to 7.0</title>
		<link rel="alternate" type="text/html" href="https://pmg.proxmox.com/mediawiki/index.php?title=Upgrade_from_6.x_to_7.0&amp;diff=163"/>
		<updated>2026-05-22T14:13:30Z</updated>

		<summary type="html">&lt;p&gt;L.Leahu-Vladucu: Update links to contain information regarding archive CDNs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
Proxmox Mail Gateway 7.x is based on the new major version of Debian (Bullseye). Carefully plan the upgrade, &#039;&#039;&#039;make and verify backups&#039;&#039;&#039; before beginning, and test extensively. Depending on the existing configuration, several manual steps — including some downtime — may be required.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; A valid and tested backup is &#039;&#039;always&#039;&#039; required, before starting the upgrade process. Test the backup beforehand in a test lab setup.&lt;br /&gt;
&lt;br /&gt;
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 Bullseye.&lt;br /&gt;
&lt;br /&gt;
In general, there are two ways to upgrade a Proxmox Mail Gateway 6.x system to Proxmox Mail Gateway 7.0:&lt;br /&gt;
&lt;br /&gt;
* A new installation (restoring the configuration and database from the backup)&lt;br /&gt;
* An in-place upgrade via apt (step-by-step)&lt;br /&gt;
&lt;br /&gt;
In both cases, emptying the browser cache and reloading the GUI is required after the upgrade.&lt;br /&gt;
&lt;br /&gt;
= New Installation =&lt;br /&gt;
&lt;br /&gt;
* Install Proxmox Mail Gateway in one of the following three ways:&lt;br /&gt;
** As a [https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#pmg_install_on_debian_container container on top of Debian Bullseye]&lt;br /&gt;
** [https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#pmg_install_on_debian On top of Debian Bullseye]&lt;br /&gt;
** By using the [https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#pmg_install_iso ISO image]&lt;br /&gt;
* Restore the backup which you made before the upgrade.&lt;br /&gt;
* Change the IP address and hostname.&lt;br /&gt;
* For &#039;&#039;&#039;clustered setups&#039;&#039;&#039;: &lt;br /&gt;
** On the master, remove all nodes from the cluster&lt;br /&gt;
** Upgrade the master&lt;br /&gt;
** Set the nodes up fresh, then join them to the upgraded master-node (recreate the cluster).&lt;br /&gt;
&lt;br /&gt;
= In-Place Upgrade =&lt;br /&gt;
== Preconditions ==&lt;br /&gt;
&lt;br /&gt;
The following actions need to be carried out from the command line.&lt;br /&gt;
&lt;br /&gt;
Perform the actions via console or SSH. If you use SSH you should use a terminal multiplexer (for example, tmux or screen) to ensure the upgrade can continue even if the SSH connection gets interrupted.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do not carry out the upgrade via the web-interface (GUI) console, as that will get interrupted during the upgrade!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Old releases must use [https://forum.proxmox.com/threads/new-archive-cdn-for-end-of-life-eol-releases.178957/ the archive CDN for Proxmox] and [https://www.debian.org/distrib/archive for Debian], so make sure that all repositories in &amp;lt;code&amp;gt;/etc/apt/sources.list&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/etc/apt/sources.list.d/*.list&amp;lt;/code&amp;gt; use:&lt;br /&gt;
* &amp;lt;code&amp;gt;archive.debian.org&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;*.debian.org&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;archive.proxmox.com&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;*.proxmox.com&amp;lt;/code&amp;gt;&lt;br /&gt;
* In case certificate errors occur while running &amp;lt;code&amp;gt;apt-get update&amp;lt;/code&amp;gt;, use HTTP instead of HTTPS for the repositories.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Upgrade to the latest version of Proxmox Mail Gateway 6.4 first.&lt;br /&gt;
*:&amp;lt;pre&amp;gt;&lt;br /&gt;
*::apt update&lt;br /&gt;
*::apt dist-upgrade&lt;br /&gt;
*:&amp;lt;/pre&amp;gt;&lt;br /&gt;
*: You can check the web-interface (reload) at the top, or use &amp;lt;code&amp;gt;pmgversion&amp;lt;/code&amp;gt;. Both must show a version with 6.4-4 (or newer), for example something like &amp;lt;code&amp;gt;pmg-api/6.4-4/...&amp;lt;/code&amp;gt; for the CLI command.&lt;br /&gt;
*: If you still see an older version, you should ensure that you have valid [https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#pmg_package_repositories package repositories] configured.&lt;br /&gt;
* Make a valid and tested backup of Proxmox Mail Gateway.&lt;br /&gt;
*: You can either create and download one from the web-interface, store it on your Proxmox Backup Server or create it from the CLI with &amp;lt;code&amp;gt;pmgbackup backup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* At least 4 GiB free disk space on root mount point.&lt;br /&gt;
* Check [[Upgrade_from_6.x_to_7.0#Potential_issues|known upgrade issues]]&lt;br /&gt;
&lt;br /&gt;
In-place upgrades are carried out using APT. &#039;&#039;&#039;Familiarity with APT is required to proceed with this upgrade mechanism. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Actions step-by-step ==&lt;br /&gt;
&lt;br /&gt;
Please first ensure that your Mail Gateway 6 system is up-to-date and that a valid backup has been created before starting the upgrade process.&lt;br /&gt;
If you need to adapt the configuration, do this now. In case you have a cluster, wait for all config-changes to be synced to all nodes before continuing.&lt;br /&gt;
&lt;br /&gt;
=== For clusters ===&lt;br /&gt;
* If you have a &#039;&#039;&#039;cluster&#039;&#039;&#039;, stop and mask all cluster-daemons &#039;&#039;&#039;on all nodes&#039;&#039;&#039; before you start the upgrade of the first node.&lt;br /&gt;
*:&amp;lt;pre&amp;gt;&lt;br /&gt;
*:: systemctl stop pmgmirror pmgtunnel&lt;br /&gt;
*:: systemctl mask pmgmirror pmgtunnel&lt;br /&gt;
*:&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Then proceed by upgrading all nodes sequentially.&lt;br /&gt;
* The Mail Gateway service will be provided by the other nodes, which aren&#039;t currently being upgraded.&lt;br /&gt;
* Certain operations (for example config changes) will only work once all nodes have been upgraded.&lt;br /&gt;
&lt;br /&gt;
=== Update the configured APT repositories ===&lt;br /&gt;
Change the apt sources to Bullseye - see [https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#pmg_package_repositories Package Repositories]&lt;br /&gt;
Update all Debian repository entries to Bullseye.&lt;br /&gt;
&lt;br /&gt;
 sed -i &#039;s/buster\/updates/bullseye-security/g;s/buster/bullseye/g&#039; /etc/apt/sources.list&lt;br /&gt;
&lt;br /&gt;
Note that for Bullseye, Debian changed its security update repository from &amp;lt;code&amp;gt;deb http://security.debian.org buster/updates main&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;deb http://security.debian.org bullseye-security main&amp;lt;/code&amp;gt; for more consistency.&lt;br /&gt;
The above command accounts for this change already.&lt;br /&gt;
&lt;br /&gt;
Update the enterprise repository to Bullseye:&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;deb https://enterprise.proxmox.com/debian/pmg bullseye pmg-enterprise&amp;quot; &amp;gt; /etc/apt/sources.list.d/pmg-enterprise.list&lt;br /&gt;
&lt;br /&gt;
Make sure to also update any extra files that you added to &amp;lt;code&amp;gt;/etc/apt/sources.list.d/&amp;lt;/code&amp;gt; to Bullseye accordingly.&lt;br /&gt;
&lt;br /&gt;
In case [https://forum.proxmox.com/threads/new-archive-cdn-for-end-of-life-eol-releases.178957/ the archive CDN for Proxmox] and [https://www.debian.org/distrib/archive for Debian] have been used, please switch back to the normal [https://pve.proxmox.com/wiki/Package_Repositories Package Repositories].&lt;br /&gt;
 &lt;br /&gt;
=== Stop and mask services before upgrade ===&lt;br /&gt;
&lt;br /&gt;
This is necessary to prevent changes to the database before and during the upgrade.&lt;br /&gt;
&lt;br /&gt;
* Stop postfix and all Proxmox Mail Gateway services (emails will be queued by the servers trying to contact the Proxmox Mail Gateway)&lt;br /&gt;
:&amp;lt;pre&amp;gt;systemctl stop postfix pmg-smtp-filter pmgpolicy pmgdaemon pmgproxy pmgmirror pmgtunnel&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Mask postfix and all Proxmox Mailgateway services to prevent them from starting during the upgrade:&lt;br /&gt;
:&amp;lt;pre&amp;gt;systemctl mask postfix pmg-smtp-filter pmgpolicy pmgdaemon pmgproxy pmgmirror pmgtunnel&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Upgrade the system ===&lt;br /&gt;
&lt;br /&gt;
 apt update&lt;br /&gt;
 apt dist-upgrade&lt;br /&gt;
&lt;br /&gt;
It is not necessary to reboot yet.&lt;br /&gt;
&lt;br /&gt;
=== Upgrade the PostgreSQL database ===&lt;br /&gt;
&lt;br /&gt;
* Before upgrading the PostgreSQL main cluster, you need to remove the automatically created cluster in the new version.&lt;br /&gt;
:&amp;lt;pre&amp;gt;pg_dropcluster --stop 13 main&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Upgrade the PostgreSQL main cluster from 11 to 13, using &amp;lt;code&amp;gt;pg_upgradecluster&amp;lt;/code&amp;gt;&lt;br /&gt;
** This step will need some &#039;&#039;&#039;time&#039;&#039;&#039; and enough &#039;&#039;&#039;free diskspace&#039;&#039;&#039; as it will create another database containing your rules, statistics, and quarantine information.&lt;br /&gt;
** If possible, use the default setting of dumping the old databases and restoring them, to avoid problems.&lt;br /&gt;
:&amp;lt;pre&amp;gt;pg_upgradecluster -v 13 11 main&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Unmask postfix and all &#039;&#039;&#039;non-cluster&#039;&#039;&#039; Proxmox Mail Gateway services to enable them again.&lt;br /&gt;
:&amp;lt;pre&amp;gt;systemctl unmask postfix pmg-smtp-filter pmgpolicy pmgdaemon pmgproxy&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Reboot and then check the journal to ensure that everything is running correctly again.&lt;br /&gt;
:&amp;lt;pre&amp;gt;reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Reconnect to the node after it successfully rebooted&lt;br /&gt;
&lt;br /&gt;
* You can remove the old PostgreSQL version and its data now, if all is working as expected:&lt;br /&gt;
:&amp;lt;pre&amp;gt;apt purge postgresql-11 postgresql-client-11&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== After the Proxmox Mail Gateway upgrade ==&lt;br /&gt;
&lt;br /&gt;
After upgrading, unmask and start all cluster-daemons on &#039;&#039;&#039;all nodes&#039;&#039;&#039;. This applies to upgrades of a single node, as well as to upgrades of all nodes in a clustered setup:&lt;br /&gt;
 systemctl unmask pmgmirror pmgtunnel&lt;br /&gt;
 systemctl start pmgmirror pmgtunnel&lt;br /&gt;
&lt;br /&gt;
= Known issues and deprecations =&lt;br /&gt;
&lt;br /&gt;
* New default bind address for pmgproxy, unifying the default behavior with Proxmox Backup Server and Proxmox VE&lt;br /&gt;
** In making the LISTEN_IP configurable, the daemon now binds to both wildcard addresses (IPv4 &amp;lt;code&amp;gt;0.0.0.0:8006&amp;lt;/code&amp;gt; and IPv6 &amp;lt;code&amp;gt;[::]:8006&amp;lt;/code&amp;gt;) by default.&lt;br /&gt;
*: Should you wish to prevent it from listening on IPv6, simply configure the IPv4 wildcard as LISTEN_IP in &amp;lt;code&amp;gt;/etc/default/pmgproxy&amp;lt;/code&amp;gt;:&lt;br /&gt;
*: &amp;lt;code&amp;gt;LISTEN_IP=&amp;quot;0.0.0.0&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
** Additionally, the logged IP address format changed for IPv4 in pmgproxy&#039;s access log (&amp;lt;code&amp;gt;/var/log/pmgproxy/pmgproxy.log&amp;lt;/code&amp;gt;). They are now logged as IPv4-mapped IPv6 addresses, so instead of:&lt;br /&gt;
*: &amp;lt;code&amp;gt;192.168.16.68 - root@pam [10/04/2021:12:35:11 +0200] &amp;quot;GET /api2/json/config/ruledb/digest HTTP/1.1&amp;quot; 200 51&amp;lt;/code&amp;gt;&lt;br /&gt;
*: the line now looks like:&lt;br /&gt;
*: &amp;lt;code&amp;gt;::ffff:192.168.16.68 - root@pam [10/04/2021:12:35:11 +0200] &amp;quot;GET /api2/json/config/ruledb/digest HTTP/1.1&amp;quot; 200 51&amp;lt;/code&amp;gt;&lt;br /&gt;
*:If you want to restore the old logging format, also set &amp;lt;code&amp;gt;LISTEN_IP=&amp;quot;0.0.0.0&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The ClamAV SafeBrowsing feature has [https://blog.clamav.net/2021/04/are-you-still-attempting-to-download.html been deprecated upstream some time ago]&lt;br /&gt;
** The config option in &amp;lt;code&amp;gt;pmg.conf&amp;lt;/code&amp;gt; is now considered deprecated and will be dropped with PMG 8.0.&lt;br /&gt;
** The configuration template &amp;lt;code&amp;gt;freshclam.conf.in&amp;lt;/code&amp;gt; has the relevant sections removed (rendering the configuration option useless).&lt;br /&gt;
** If you&#039;ve set the option (&amp;lt;code&amp;gt;grep safebrowsing /etc/pmg/pmg.conf&amp;lt;/code&amp;gt; produces output) - please remove it.&lt;br /&gt;
&lt;br /&gt;
= Potential issues =&lt;br /&gt;
&lt;br /&gt;
== General ==&lt;br /&gt;
&lt;br /&gt;
As a Debian based Distribution, Proxmox Mail Gateway is affected by most issues and changes affecting Debian.&lt;br /&gt;
Thus, ensure to read the [https://www.debian.org/releases/bullseye/amd64/release-notes/ch-information.en.html upgrade specific issues for Bullseye].&lt;br /&gt;
&lt;br /&gt;
== Installations as Container on Proxmox VE ==&lt;br /&gt;
&lt;br /&gt;
The newer version of &amp;lt;code&amp;gt;systemd&amp;lt;/code&amp;gt; inside the container requires that the &amp;lt;code&amp;gt;nesting&amp;lt;/code&amp;gt; feature has to be enabled for the container.&lt;br /&gt;
This is needed in order for many essential services to be able to run.&lt;br /&gt;
Keep in mind that this makes running privileged containers an even greater risk, thus it is recommended to only use unprivileged containers.&lt;br /&gt;
&lt;br /&gt;
== non-usr-merged layouts ==&lt;br /&gt;
Most Proxmox Mail Gateway installations still have /bin and /usr/bin as separate directories - this is deprecated as of Debian Bullseye/11 and will become unsupported in Debian Bookworm/12.&lt;br /&gt;
&lt;br /&gt;
See [https://www.debian.org/releases/bullseye/amd64/release-notes/ch-information.en.html#deprecated-components Deprecated Components] for migration instructions.&lt;br /&gt;
&lt;br /&gt;
Usually creating a backup of the system and installing the &amp;lt;code&amp;gt;usrmerge&amp;lt;/code&amp;gt; package is all that is needed.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
[https://www.debian.org/releases/bullseye/amd64/release-notes/ Release Notes for Debian 11.0 (bullseye), 64-bit PC]&lt;br /&gt;
&lt;br /&gt;
[[Category: Upgrade]]&lt;/div&gt;</summary>
		<author><name>L.Leahu-Vladucu</name></author>
	</entry>
	<entry>
		<id>https://pmg.proxmox.com/mediawiki/index.php?title=Upgrade_from_5.x_to_6.0&amp;diff=162</id>
		<title>Upgrade from 5.x to 6.0</title>
		<link rel="alternate" type="text/html" href="https://pmg.proxmox.com/mediawiki/index.php?title=Upgrade_from_5.x_to_6.0&amp;diff=162"/>
		<updated>2026-05-22T14:07:10Z</updated>

		<summary type="html">&lt;p&gt;L.Leahu-Vladucu: Update links to contain information regarding archive CDNs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
Proxmox Mail Gateway 6.x is based on a new major version of Debian. Carefully plan the upgrade, &#039;&#039;&#039;make and verify backups&#039;&#039;&#039; before beginning, and test extensively. Depending on the existing configuration, several manual steps — including some downtime — may be required.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; A valid and tested backup is &#039;&#039;always&#039;&#039; needed before starting the upgrade process. Test the backup beforehand in a test lab setup.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
In general, there are two ways to upgrade a Proxmox Mail Gateway 5.x system to Proxmox Mail Gateway 6.x:&lt;br /&gt;
&lt;br /&gt;
*A new installation (and restoring the configuration and database from the backup)&lt;br /&gt;
*An in-place upgrade via apt (step-by-step)&lt;br /&gt;
&lt;br /&gt;
In both cases emptying the browser cache and reloading the GUI page is required after the upgrade.&lt;br /&gt;
&lt;br /&gt;
= New Installation =&lt;br /&gt;
* Install Proxmox Mail Gateway in one of the following three ways:&lt;br /&gt;
** 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]&lt;br /&gt;
** [https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#_install_proxmox_mail_gateway_on_debian On top of Debian Buster]&lt;br /&gt;
** By using the [https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#_using_the_proxmox_mail_gateway_installation_cd_rom ISO image]&lt;br /&gt;
* Restore the backup you have made before the upgrade.&lt;br /&gt;
* Change the IP address and the hostname.&lt;br /&gt;
* For &#039;&#039;&#039;clustered setups&#039;&#039;&#039;: &lt;br /&gt;
** setup the slaves again&lt;br /&gt;
** then join them to the upgraded master-node (recreate the cluster).&lt;br /&gt;
&lt;br /&gt;
= In-place Upgrade =&lt;br /&gt;
== Preconditions ==&lt;br /&gt;
&lt;br /&gt;
Old releases must use [https://forum.proxmox.com/threads/new-archive-cdn-for-end-of-life-eol-releases.178957/ the archive CDN for Proxmox] and [https://www.debian.org/distrib/archive for Debian], so make sure that all repositories in &amp;lt;code&amp;gt;/etc/apt/sources.list&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/etc/apt/sources.list.d/*.list&amp;lt;/code&amp;gt; use:&lt;br /&gt;
* &amp;lt;code&amp;gt;archive.debian.org&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;*.debian.org&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;archive.proxmox.com&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;*.proxmox.com&amp;lt;/code&amp;gt;&lt;br /&gt;
* In case certificate errors occur while running &amp;lt;code&amp;gt;apt-get update&amp;lt;/code&amp;gt;, use HTTP instead of HTTPS for the repositories.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Upgrade to the latest version of Proxmox Mail Gateway 5.2.&lt;br /&gt;
 apt update&lt;br /&gt;
 apt dist-upgrade&lt;br /&gt;
&lt;br /&gt;
* Make a valid and tested backup of Proxmox Mail Gateway, either create and download it from the Webinterface, or do so on the CLI:&lt;br /&gt;
 pmgbackup backup&lt;br /&gt;
&lt;br /&gt;
* At least 1GB free disk space at root mount point.&lt;br /&gt;
* Check [[Upgrade_from_5.x_to_6.0#Potential_issues|known upgrade issues]]&lt;br /&gt;
&lt;br /&gt;
In-place upgrades are done with apt. &#039;&#039;&#039;Familiarity with apt is required to proceed with this upgrade mechanism. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Actions step-by-step ==&lt;br /&gt;
&lt;br /&gt;
Please ensure first that your Mail Gateway 5 system is up-to-date before starting the upgrade process.&lt;br /&gt;
&lt;br /&gt;
=== Update the configured APT repositories ===&lt;br /&gt;
&lt;br /&gt;
Change the apt sources to Buster - see [https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#pmg_package_repositories Package Repositories]&lt;br /&gt;
 sed -i &#039;s/stretch/buster/g&#039; /etc/apt/sources.list&lt;br /&gt;
&lt;br /&gt;
Make sure to also edit all files in &amp;lt;code&amp;gt;/etc/apt/sources.list.d/&amp;lt;/code&amp;gt; accordingly. For a Installation from the ISO&lt;br /&gt;
with the enterprise repository the following command will work:&lt;br /&gt;
 echo &amp;quot;deb http://archive.proxmox.com/debian/pmg buster pmg-enterprise&amp;quot; &amp;gt; /etc/apt/sources.list.d/pmg-enterprise.list&lt;br /&gt;
&lt;br /&gt;
=== Stop and Mask Services Before Upgrade ===&lt;br /&gt;
&lt;br /&gt;
This is necessary to prevent changes to the database before and during the upgrade.&lt;br /&gt;
&lt;br /&gt;
* Stop postfix and all Proxmox Mail Gateway services (emails will be queued by the servers trying to contact the Proxmox Mail Gateway)&lt;br /&gt;
 systemctl stop postfix pmg-smtp-filter pmgpolicy pmgdaemon pmgproxy pmgmirror pmgtunnel&lt;br /&gt;
* Mask postfix and all Proxmox Mailgateway services to prevent them from starting during the upgrade&lt;br /&gt;
 systemctl mask postfix pmg-smtp-filter pmgpolicy pmgdaemon pmgproxy pmgmirror pmgtunnel&lt;br /&gt;
&lt;br /&gt;
=== For Clusters ===&lt;br /&gt;
&lt;br /&gt;
* If you have a &#039;&#039;&#039;cluster&#039;&#039;&#039;, stop and mask all cluster-daemons &#039;&#039;&#039;on all nodes&#039;&#039;&#039; before you start the upgrade of the first node.&lt;br /&gt;
 systemctl stop pmgmirror pmgtunnel&lt;br /&gt;
 systemctl mask pmgmirror pmgtunnel&lt;br /&gt;
* Then proceed by upgrading all nodes sequentially.&lt;br /&gt;
* The mail gateway service is provided by the other nodes, currently not being upgraded.&lt;br /&gt;
* Certain operations (for example config changes) will only work once all nodes have been upgraded.&lt;br /&gt;
&lt;br /&gt;
=== Upgrade The System ===&lt;br /&gt;
&lt;br /&gt;
 apt update&lt;br /&gt;
 apt dist-upgrade&lt;br /&gt;
&lt;br /&gt;
It is not necessary to reboot yet.&lt;br /&gt;
&lt;br /&gt;
=== Upgrade postgres Database ===&lt;br /&gt;
&lt;br /&gt;
* Before you upgrade the postgres main cluster, you need to remove the automatically created cluster in the new version.&lt;br /&gt;
 pg_dropcluster --stop 11 main&lt;br /&gt;
* Upgrade the postgres main cluster from 9.6 to 11 by using &amp;lt;code&amp;gt;pg_upgradecluster&amp;lt;/code&amp;gt;&lt;br /&gt;
** If possible, use the default setting of dumping the old databases and restoring them to avoid problems.&lt;br /&gt;
 pg_upgradecluster -v 11 9.6 main&lt;br /&gt;
* If you want to do an in-place upgrade (using &amp;lt;code&amp;gt;pg_upgrade&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;pg_dump&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;pg_restore&amp;lt;/code&amp;gt;), you need to &amp;lt;code&amp;gt;REINDEX&amp;lt;/code&amp;gt; all databases due to an incompatibility in glibc:&lt;br /&gt;
** https://postgresql.verite.pro/blog/2018/08/27/glibc-upgrade.html&lt;br /&gt;
** https://lists.debian.org/debian-glibc/2019/03/msg00030.html&lt;br /&gt;
** https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=927129&lt;br /&gt;
&lt;br /&gt;
* Unmask postfix and all &#039;&#039;&#039;non-cluster&#039;&#039;&#039; Proxmox Mail Gateway services to enable them again.&lt;br /&gt;
 systemctl unmask postfix pmg-smtp-filter pmgpolicy pmgdaemon pmgproxy&lt;br /&gt;
* Reboot and control the journal to ensure that everything runs correctly.&lt;br /&gt;
&lt;br /&gt;
 reboot&lt;br /&gt;
&lt;br /&gt;
* Remove the old postgres version and its data:&lt;br /&gt;
 apt purge postgresql-9.6 postgresql-client-9.6 postgresql-contrib-9.6&lt;br /&gt;
&lt;br /&gt;
== After the Proxmox Mail Gateway upgrade ==&lt;br /&gt;
&lt;br /&gt;
After upgrading, unmask and start all cluster-daemons on &#039;&#039;&#039;all nodes&#039;&#039;&#039;. This applies to upgrades of a single node as well as to upgrades of all nodes in a clustered setup:&lt;br /&gt;
 systemctl unmask pmgmirror pmgtunnel&lt;br /&gt;
 systemctl start pmgmirror pmgtunnel&lt;br /&gt;
&lt;br /&gt;
= Potential issues =&lt;br /&gt;
&lt;br /&gt;
== General ==&lt;br /&gt;
&lt;br /&gt;
As a Debian based Distribution, Proxmox Mail Gateway is affected by most issues and changes affecting Debian.&lt;br /&gt;
So ensure to read the [https://www.debian.org/releases/buster/amd64/release-notes/ch-information.en.html Upgrade specific issues for buster]&lt;br /&gt;
&lt;br /&gt;
Especially the [https://www.debian.org/releases/buster/amd64/release-notes/ch-information.en.html#openssl-defaults OpenSSL default version and security level raised] and [https://www.debian.org/releases/buster/amd64/release-notes/ch-information.en.html#su-environment-variables Semantics for using environment variables for su changed]&lt;br /&gt;
&lt;br /&gt;
== Postgres And Other Template Modifications ==&lt;br /&gt;
If you&#039;ve modified the configuration template for postgresql (&amp;lt;code&amp;gt;/var/lib/pmg/templates/postgresql.conf&amp;lt;/code&amp;gt;), make sure to compare and update your copy in &amp;lt;code&amp;gt;/etc/pmg/templates/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also compare all other templates you&#039;ve overriden for new changes through the packages.&lt;br /&gt;
&lt;br /&gt;
== Service Failure Caused By Apparmor Featureset Missmatch ==&lt;br /&gt;
Debian Buster installs apparmor, if you still have the Debian stock kernel installed (&amp;lt;code&amp;gt;linux-image-4.19.0-5-amd64&amp;lt;/code&amp;gt; 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. &amp;lt;code&amp;gt;clamav&amp;lt;/code&amp;gt;) do not start. Currently you can mitigate the issue in two ways:&lt;br /&gt;
* preferred: uninstall &amp;lt;code&amp;gt;apparmor&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;apt remove apparmor&amp;lt;/code&amp;gt;&lt;br /&gt;
* disable feature-pinning in apparmor by commenting out or deleting the line &amp;lt;code&amp;gt;features-file=/usr/share/apparmor-features/features&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;/etc/apparmor/parser.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Logrotation (rsyslog) ==&lt;br /&gt;
If you&#039;ve modified &amp;lt;code&amp;gt;/etc/logrotate.d/rsyslog&amp;lt;/code&amp;gt; make sure to compare the file upon upgrade - the &amp;lt;code&amp;gt;postrotate&amp;lt;/code&amp;gt; script changed. Without the new script logrotation does not work which also breaks the tracking center. The &amp;lt;code&amp;gt;postrotate&amp;lt;/code&amp;gt; script needs to be:&lt;br /&gt;
 /usr/lib/rsyslog/rsyslog-rotate&lt;br /&gt;
&lt;br /&gt;
= External links =&lt;br /&gt;
&lt;br /&gt;
*[https://www.debian.org/releases/buster/amd64/release-notes/ Release Notes for Debian 10.0 (buster), 64-bit PC]&lt;br /&gt;
&lt;br /&gt;
[[Category: Upgrade]]&lt;/div&gt;</summary>
		<author><name>L.Leahu-Vladucu</name></author>
	</entry>
</feed>