[SERVER-2459] Omit some collections with mongodump Created: 01/Feb/11  Updated: 12/Jul/16  Resolved: 13/Jun/14

Status: Closed
Project: Core Server
Component/s: Tools
Affects Version/s: None
Fix Version/s: 2.7.2

Type: New Feature Priority: Minor - P4
Reporter: Roger Binns Assignee: Shaun Verch
Resolution: Done Votes: 43
Labels: community-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Current stable on Ubuntu 10.10 64 bit


Issue Links:
Duplicate
is duplicated by SERVER-2871 mongodump: add option to exclude coll... Closed
Tested
Backwards Compatibility: Fully Compatible
Sprint: Server 2.7.2
Participants:

 Description   

My databases are each many collections, but some do not need backing up (they are thumbnails and similar)

I'd like an option to mongodump to specifically exclude some collections, ideally some sort of prefix or glob wildcard. Some of these collections are actually gridfs hence more convoluted names. Something like this would be great:

mongodump --exclude-collections 'thumbnails*'

It is also far easier to do this (blacklisting) than listing what I do want (whitelisting, current command line flags) since the collection names change all the time and it would be a pain to track.



 Comments   
Comment by Githook User [ 13/Jun/14 ]

Author:

{u'name': u'Shaun Verch', u'email': u'shaun.verch@mongodb.com'}

Message: SERVER-2459 Add excludeCollection and excludeCollectionsWithPrefix options to mongodump
Branch: master
https://github.com/mongodb/mongo/commit/c9b6f371a00112af31b5fc76297ab3605d47dd25

Comment by Martin Konecny [ 19/May/14 ]

+1 Please add this feature.

Comment by Matt Kangas [ 16/May/14 ]

pull/163 had 18 additional "+1" comments on it, so clearly there is strong interest in this feature request. But it only supported excluding exactly one collection.

A more general purpose solution would support one or more of:

  1. "--excludeCollection" which can be specified multiple times
  2. "--excludeCollectionsWithPrefix" - match on prefix
  3. Some kind of glob-like pattern matching, as originally suggested

A new pattern matching language is less desirable from our perspective. But options 1 and 2 seem viable and widely useful.

Comment by Sorin Neacsu [ 30/Apr/14 ]

Come on guys, this is ridiculous, it's such an easy thing to implement, you already have a pull request, and it saves alot of time and headaches ....

Comment by Nic Cottrell (Personal) [ 27/Mar/14 ]

Yeah - i have a capped collection containing a sort of running log which never needs backing up. A flag to skip capped collection would also be useful!

Comment by Stephen Coetzee [ 01/Oct/13 ]

Is there any reason something this simple has not been done in the nearly 3 years this issue has been open?
Someone even wrote a patch and a pull request, they did the work for you.

Comment by Russell Smith [ 25/Apr/13 ]

I'm coming across this issue when trying to use a read-only user...which could be fixed with this ticket;

retinalols:backups russ$ mongodump --forceTableScan -h xxxxxxx --port xxxxxx -u backup -p xxxxxxx -d xxxxxx
connected to: xxxxxxx:xxxxxxx
Wed Apr 24 17:00:21.635 DATABASE: xxxxxxx	 to dump/xxxxxxx
Wed Apr 24 17:00:21.801 xxxxxxx.system.indexes to dump/xxxxxxx/system.indexes.bson
Wed Apr 24 17:00:22.048 65 objects
Wed Apr 24 17:00:22.049 xxxxxxx.system.users to dump/xxxxxxx/system.users.bson
assertion: 11010 count fails:{ ok: 0.0, errmsg: "unauthorized" }

Comment by sanket kolhe [ 07/Mar/13 ]

I have only single collection of 30% of total size . It will be great if i can dump with excluding this collections

Comment by Evan Adelman [ 23/Nov/12 ]

i have a 80GB collection that would be ideal to be outside of normal dumps.

Comment by Chris Ferry [ 10/May/12 ]

What's going on with this request? I have a 45GB collection that I don't want to dump.
This seems like a logical feature to have in a database backup utility.

Comment by Ted Behling [ 17/Jan/12 ]

FYI, I forked mongo on Github and wrote a patch to implement this feature. I plan to send a pull request. My fork is https://github.com/tedb/mongo . Pull request is at https://github.com/mongodb/mongo/pull/163 .

Comment by Eliot Horowitz (Inactive) [ 04/Dec/11 ]

Not very soon - I would recommend whitelisting for now.

Comment by Graham Hargreaves [ 04/Dec/11 ]

Any chance this is going to be scheduled in soon, major problem for me backing up GB of data I don't need.

Generated at Thu Feb 08 03:00:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.