Restore from an incremental backup¶
To restore a backup, use the pbm restore
command supplying the backup name from which you intend to restore. Percona Backup for MongoDB identifies the type of the backup (physical, logical or incremental) and restores the database up to the restore_to_time timestamp (available in pbm list
output starting with version 1.4.0).
Considerations¶
- The Percona Server for MongoDB version for both backup and restore data must be within the same major release.
- Incremental backups made with PBM before PBM 2.1.0 are incompatible for restore with PBM 2.1.0 and onwards.
- Physical restores are not supported for deployments with arbiter nodes.
Before you start¶
Before you start, shut down all mongos
nodes, pmm-agent
processes and clients that can do writes to the database as it won’t be available while the restore is in progress.
Restore a database¶
Restore flow from an incremental backup is the same as the restore from a full physical backup: specify the backup name for the pbm restore
command:
$ pbm restore 2022-11-25T14:13:43Z
Percona Backup for MongoDB recognizes the backup type, finds the base incremental backup, restores the data from it and then restores the modified data from applicable incremental backups.
Post-restore steps¶
After the restore is complete, do the following:
-
Restart all
mongod
nodes andpbm-agents
.Note
You may see the following message in the
mongod
logs after the cluster restart:"s":"I", "c":"CONTROL", "id":20712, "ctx":"LogicalSessionCacheReap","msg":"Sessions collection is not set up; waiting until next sessions reap interval","attr":{"error":"NamespaceNotFound: config.system.sessions does not exist"}}}}
This is expected behavior of periodic checks upon the database start. During the restore, the
config.system.sessions
collection is dropped but Percona Server for MongoDB recreates it eventually. It is a normal procedure. No action is required from your end. -
Resync the backup list from the storage.
- Start the balancer and the
mongos
node. - As the general recommendation, make a new base backup to renew the starting point for subsequent incremental backups.
Useful links¶
Created: April 11, 2025