Percona backup configuration for MongoDB

Hello,
I’ve a self-managed 3node MongoDB cluster configured on GCE instances. I’m trying to setup incremental backup for this database,i’ve installed the pbm agents on my instances & also specified the storage location. I’m triggering a kubernetes cronjob to run backup jobs.
The backup part is working as expected for me,but i have one question…
Suppose,if one database/collection gets corrupted and i wish to restore only that particular database/collection,is there a way to restore only that db/collection in incremental db backup type?? because i tried to restore using "pbm restore 2024-10-01T11:21:03Z --ns="stg_gsdin_adit.* " command,but it gives me this error “Error: --ns flag is only allowed for logical restore” …Does this mean that in incremental backup i cannot restore only a certain database/collection?? or is there a way to achieve the same??
Please help on this.

Thanks.

Hey Wali_Hasan,
Yes, you can use only the logical backup to restore a particular namespace - selective restore. You can check here for its limitations - Selective backup and restore - Percona Backup for MongoDB.
With incremental backup, you have to follow some workarounds to achieve what you need:

  1. setup a new environment and restore the desired incremental backup into it
  2. Backup the collection/db - NS that you need to restore using mongodump tool
  3. Then restore (mongorestore) that particular backup in the source with --drop option

Regards,
Vinodh Guruji

Hi @Vinodh_Krishnaswamy,
I do not wish to use mongodump and mongorestore cli tools,this would then defeat the whole purpose of using pbm for backup & restore.
So as per the documentation,it means that in incremental backups only full db restore is possible,hmmm.