Upgrade Percona Backup for MongoDB¶
The recommended and most convenient way to upgrade PBM is from Percona repositories.
Important notes¶
-
Backward compatibility between data backup and restore is supported for upgrades within one major version only (for example, from 1.1.x to 1.2.y). When you upgrade Percona Backup for MongoDB over several major versions (for example, from 1.0.x to 1.2.y), we recommend to make a backup right after the upgrade.
-
Percona Backup for MongoDB v1.5.0 and later is incompatible with Percona Backup for MongoDB v1.4.1 and earlier due to different processing of system collections
Users
andRoles
during backup / restore operations. After the upgrade to Percona Backup for MongoDB v1.5.0 and later, make sure to make a fresh backup. -
Starting from v1.7.0, the user running the
pbm-agent
process is changed frompbm
tomongod
. This is done for the following reasons:-
To make physical backups and restores, the user running the
pbm-agent
process must have the read / write permissions to the MongoDBdataDir
. -
To use the filesystem-based backup storage, the user running the
pbm-agent
process must also have the read / write permissions to the backup directory.
-
-
Starting from version 1.3.0, Percona Backup for MongoDB packages are stored in the
pbm
repository and thetools
repository for backward compatibility. -
Upgrade Percona Backup for MongoDB on all nodes where it is installed.
Prerequisites¶
-
Install
percona-release
tool or update it to the latest version. -
Enable the repository
$ sudo percona-release enable pbm release
Note: For apt
-based systems, run sudo apt update
to update the local cache.
Upgrade to the latest version¶
Run all commands as root or via sudo
.
-
Stop
pbm-agent
$ sudo systemctl stop pbm-agent
-
Install new packages
$ sudo apt install percona-backup-mongodb
-
Reload the
systemd
processStarting from v1.7.0, reload the
systemd
process to update the unit file with the following command:$ sudo systemctl daemon-reload
-
Update permissions
For a filesystem-based backup storage, grant read / write permissions to the backup directory to the
mongod
user. -
Start
pbm-agent
$ sudo systemctl start pbm-agent
Run all commands as root or via sudo
.
-
Stop
pbm-agent
$ sudo systemctl stop pbm-agent
-
Install new packages
$ sudo yum install percona-backup-mongodb
-
Reload the
systemd
process
Starting from v1.7.0, reload the systemd
process to update the unit file with the following command:
$ sudo systemctl daemon-reload
-
Update permissions
For a filesystem-based backup storage, grant read / write permissions to the backup directory to the
mongod
user. -
Start
pbm-agent
$ sudo systemctl start pbm-agent
Upgrade to a specific version¶
Run all commands as root or via sudo
.
-
List available versions
$ sudo apt-cache madison percona-backup-mongodb
Sample output
percona-backup-mongodb | 1.8.1-1.stretch | http://repo.percona.com/tools/apt stretch/main amd64 Packages percona-backup-mongodb | 1.8.0-1.stretch | http://repo.percona.com/tools/apt stretch/main amd64 Packages percona-backup-mongodb | 1.7.0-1.stretch | http://repo.percona.com/tools/apt stretch/main amd64 Packages percona-backup-mongodb | 1.6.1-1.stretch | http://repo.percona.com/tools/apt stretch/main amd64 Packages percona-backup-mongodb | 1.6.0-1.stretch | http://repo.percona.com/tools/apt stretch/main amd64 Packages percona-backup-mongodb | 1.5.0-1.stretch | http://repo.percona.com/tools/apt stretch/main amd64 Packages
-
Stop
pbm-agent
$ sudo systemctl stop pbm-agent
-
Install packages
Install a specific version packages. For example, to upgrade to Percona Backup for MongoDB 1.7.0, run the following command:
$ sudo apt install percona-backup-mongodb=1.7.0-1.stretch
-
Update permissions
For a filesystem-based backup storage, grant read / write permissions to the backup directory to the mongod
user.
-
Start
pbm-agent
$ sudo systemctl start pbm-agent
Run all commands as root or via sudo
.
-
List available versions
$ sudo yum list percona-backup-mongodb --showduplicates
Sample output
Available Packages percona-backup-mongodb.x86_64 1.8-1.el7 pbm-release-x86_64 percona-backup-mongodb.x86_64 1.8.0-1.el7 pbm-release-x86_64 percona-backup-mongodb.x86_64 1.7.0-1.el7 pbm-release-x86_64 percona-backup-mongodb.x86_64 1.6.1-1.el7 pbm-release-x86_64 percona-backup-mongodb.x86_64 1.6.0-1.el7 pbm-release-x86_64 percona-backup-mongodb.x86_64 1.5.0-1.el7 pbm-release-x86_64
-
Stop
pbm-agent
$ sudo systemctl stop pbm-agent
-
Install packages
Install a specific version packages. For example, to upgrade to Percona Backup for MongoDB 1.7.1, run the following command:
$ sudo yum install percona-backup-mongodb-1.7.1-1.el7
-
Update permissions
For a filesystem-based backup storage, grant read / write permissions to the backup directory to the
mongod
user. -
Start
pbm-agent
$ sudo systemctl start pbm-agent
Note: If MongoDB runs under a different user than mongod
(the default configuration for Percona Server for MongoDB), use the same user to run the pbm-agent
. For filesystem-based storage, grant the read / write permissions to the backup directory for this user.
Created: April 16, 2025