[SERVER-808] mongodump should backup indexes when run with --collection option Created: 22/Mar/10  Updated: 12/Jul/16  Resolved: 12/Dec/11

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

Type: Improvement Priority: Minor - P4
Reporter: Mathias Stearn Assignee: Spencer Brody (Inactive)
Resolution: Done Votes: 42
Labels: rn
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-1311 mongodump/mongorestore loses informat... Closed
Participants:

 Description   

$ ~/10gen/mongo/mongodump -d test -c twitter_live
connected to: 127.0.0.1
DATABASE: test to dump/test
test.twitter_live to dump/test/twitter_live.bson
180594 objects

doesn't backup test.twitterlive entries from system.indexes



 Comments   
Comment by Eliot Horowitz (Inactive) [ 14/Apr/11 ]

See SERVER-1311

Comment by Scott Hernandez (Inactive) [ 16/Feb/11 ]

When it backs up the indexes it doesn't backup the data, just the definition. Then on restore it recreates the indexes..

Comment by Tianon Gravi [ 16/Feb/11 ]

It's somewhat obvious, but it would also be nice to have a command line option for this functionality. Sometimes I want the indices too, but a lot of times I want just the data to save time and space.

Comment by Robbie Bow [ 24/Sep/10 ]

This feature would enable a very convenient means for creating fixture sets for testing.

Comment by Scott Hernandez (Inactive) [ 28/Jun/10 ]

It should also backup the collection properties like if it is capped, and how.

Even if the --collection flag isn't used it should backup the metadata (like in the case of the server – all dbs). MongoImport should have an option to disable the import of the metadata (creating capped collections, and indexes before loading the collection)

I'd suggest not backing up the raw data, but instead creating a companion javascript file that defines the metadata (collection + indexes) creation. This way the metadata is more easily viewable in the dump/restore process.

Making this the default behavior will ensure that when you do a dump/restore you get back the same collections and indexes as you started with.

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