Point-in-time recovery from selected databases and collections¶
Important
Supported only for replica sets. Available for logical backups.
Before you start:
- Read known limitations for selective backups and restores.
- Check that you have made a full backup because it serves as the base for point-in-time recovery. Any selective backup is ignored.
Restore the specified database or collection to a designated point in time¶
Run the restore command as follows:
```bash
pbm restore --base-snapshot <backup_name> --time <timestamp> \
--ns <db.collection>
```
To restore the desired database to a point in time, along with users and roles run:
```bash
pbm restore --time <timestamp> --ns "db.*" --with-users-and-roles
```
Version added: 2.14.0
Before a restore operation is executed you have to confirm the action (to bypass it, add the -y or --yes flag).
You can specify the selective backup as the base snapshot for the Point-in-time restore. In this case, Percona Backup for MongoDB restores only the namespace(s) included in this backup to the specified time.
Alternatively, you can use a full backup snapshot and restore the desired namespaces (databases or collections) up to the specific time from it. Specify them as the comma-separated list for the pbm restore command.
When point-in-time recovery is started, Percona Backup for MongoDB uses the provided base snapshot, restores the specified namespace(s) and replays oplog on top of it up to the specified time. If no base snapshot is provided, Percona Backup for MongoDB uses the most recent full backup snapshot.
Created: April 29, 2026