Allow to exclude collection from PBM backup

Description

Hello,

 

Is it possible to ask to have a way to exclude collection from PBM backup ?

Maybe something like
$ pbm backup --exclude-collection myDB.myCollection

 

This can be useful in order to not backup huge collection that are not at high risk or that can be purged once in a while

Or simply ignore some collection that are not mandatory to backup

Mongodump support this feature but only when you specifically dump one DB and If you have multiple DBs you need to add a mongodump line per DB

Also mongodump is not the prefered way to do a backup since MongoDB4.0+

 

Thank you very much ! Keep up the great works !

 

 

 

Environment

PBM : 1.6.1
Debian : 9/10 on AWS/GCP or on-premise

Storage : S3/Filesystem(for testing mostly)/GCS

MongoDB version : 4.2.12

MongoDB architecture : sharded cluster

Smart Checklist

Activity

Keith Murphy July 28, 2023 at 4:40 PM

this would help greatly with the integration of PBM into our clusters. There is a definite use case for it.

 

thanks!

 

Keith

Aaditya Dubey July 12, 2022 at 9:57 AM

Hi  ,

Thank you the report.
sending the concern to engineering for further review and updates.

Stefan Knott June 14, 2022 at 2:10 PM

I think this would be easily possible, at least for logical backups and a great addition.

 

Use case #1

I want to restore the data but keep the state of admin in the target database, e.g. for development / troubleshooting / restore testing.

 

Use case #2

When restoring backups that contain legacy/nonstandard admin.* collections, the restore fails without a recovery option. if i could just exclude the problematic collection from restore, that would solve the problem and disaster recovery would not fail.

 

It's easy to implement because there is already a hardcoded list of restore exclusions:

https://github.com/percona/percona-backup-mongodb/blob/main/pbm/restore/logical.go#L25-L49

 

 

Details

Assignee

Reporter

Labels

Needs Review

Yes

Needs QA

Yes

Needs Doc

Yes

Needs Packaging

No

Affects versions

Priority

Smart Checklist

Created March 3, 2022 at 1:50 PM
Updated November 26, 2024 at 4:23 PM