mongodump & restore -- indexes

4,602 views
Skip to first unread message

Steve

unread,
Dec 13, 2010, 2:05:11 PM12/13/10
to mongodb-user
Hi,

If i do a mongodump and restore of a collection (one that has
indexes), after restore, i would ask mongo to rebuild the indexes
right? is this metadata that's stored in a system table?

roger

unread,
Dec 13, 2010, 4:25:00 PM12/13/10
to mongodb-user
By default mongodump produces a file called system.indexes.bson inside
each database's dump directory.
mongorestore loads that file last within the database. Loading that
file builds indexes in the new database. Only the metadata is in these
files, so loading it will create the indexes.

There was a bug http://jira.mongodb.org/browse/SERVER-2186 that now
has been fixed in case the db name was different between old and
new.

(h/t to richard)
-Roger

Steve

unread,
Dec 13, 2010, 5:59:58 PM12/13/10
to mongodb-user
you're talking about a full db mongodump right?

i'm asking about a single collection mongodump

mongodump -d my_db -c my_col

would a single collection mongodump backup and (mongorestore) the
indexes for that collection?



On Dec 13, 1:25 pm, roger <ro...@10gen.com> wrote:
> By default mongodump produces a file called system.indexes.bson inside
> each database's dump directory.
> mongorestore loads that file last within the database. Loading that
> file builds indexes in the new database. Only the metadata is in these
> files, so loading it will create the indexes.
>
> There was a bughttp://jira.mongodb.org/browse/SERVER-2186that now

Scott Hernandez

unread,
Dec 13, 2010, 6:05:32 PM12/13/10
to mongod...@googlegroups.com
I think you want this: http://jira.mongodb.org/browse/SERVER-808

> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>
>

Steve

unread,
Dec 13, 2010, 6:26:50 PM12/13/10
to mongodb-user
never mind...i found the mongodb tracker on this. Thanks! :)

roger

unread,
Dec 13, 2010, 6:31:29 PM12/13/10
to mongodb-user
I see.. I think you're referring to http://jira.mongodb.org/browse/SERVER-808

-Roger

On Dec 13, 2:59 pm, Steve <st...@burkettnet.com> wrote:
Reply all
Reply to author
Forward
0 new messages