NAME

pmgbackup - Proxmox Mail Gateway Backup and Restore Utility

SYNOPSIS

pmgbackup <COMMAND> [ARGS] [OPTIONS]

pmgbackup backup [OPTIONS]

Backup the system configuration.

--statistic <boolean> (default = 1)

Backup statistic databases.

pmgbackup help [OPTIONS]

Get help about specified command.

--extra-args <array>

Shows help for a specific command

--verbose <boolean>

Verbose output format.

pmgbackup list

List all stored backups (files named proxmox-backup_Fri May 31 14:32:59 CEST 2019.tgz).

pmgbackup restore --filename <string> [OPTIONS]

Restore the system configuration.

--config <boolean> (default = 0)

Restore system configuration.

--database <boolean> (default = 1)

Restore the rule database. This is the default.

--filename pmg-backup_[0-9A-Za-z_-]+\.tgz

The backup file name.

--statistic <boolean> (default = 0)

Restore statistic databases. Only considered when you restore the database.

DESCRIPTION

Proxmox Mail Gateway includes the ability to backup and restore the configuration. This includes the complete config from /etc/pmg/, the mail filter rules and the statistic database.

Note The backup does not include the network setup, and also no mail data from the postfix queue or the spam or virus quarantine.

You can create a backup by simply pressing the Backup button on the GUI, or by using the command line interface:

# pmgbackup backup
starting backup to: /var/lib/pmg/backup/pmg-backup_2018_01_04_5A4E0436.tgz
backup finished

Backups are stored inside directory /var/lib/pmg/backup/. It is usually best to mount a remote file system to that directory, so that the resulting backups gets stored remotely.

You can list the contents of that directory with:

# pmgbackup list
....
pmg-backup_2017_11_10_5A05D4B9.tgz      17012
pmg-backup_2017_11_13_5A09676A.tgz      16831
pmg-backup_2018_01_04_5A4E0436.tgz      21514

Restores are also possible using the GUI or command line, and you can select what parts you want to restore:

System Configuration

Basically the contents of /etc/pmg/.

Rule Database

The mail filter rule database.

Statistic

All statistical data.

For examply, you can selectively restore the mail filter rules from an older backup:

# pmgbackup restore --filename pmg-backup_2018_01_04_5A4E0436.tgz --database
starting restore: /var/lib/pmg/backup/pmg-backup_2018_01_04_5A4E0436.tgz
config_backup.tar: OK
Proxmox_ruledb.sql: OK
Proxmox_statdb.sql: OK
version.txt: OK
Destroy existing rule database
Create new database
run analyze to speed up database queries
Analyzing/Upgrading existing Databases...done
restore finished

Copyright © 2007-2019 Proxmox Server Solutions GmbH

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/