Restoring data to a different database name on same instance

2,933 views
Skip to first unread message

Capt.Safety

unread,
Dec 22, 2010, 12:02:33 PM12/22/10
to mongodb-user
In a test environment we would like to restore a backup to a different
database name for comparison reasons. Can this be done with the
current tools?

Eliot Horowitz

unread,
Dec 22, 2010, 1:58:50 PM12/22/10
to mongod...@googlegroups.com
You can use mongodump and mongorestore to do this.
There was a bug when restoring indexes to a different database name
that was fixed in 1.7.4, but otherwise works fine all versions.

> --
> 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.
>
>

Capt.Safety

unread,
Dec 22, 2010, 3:20:24 PM12/22/10
to mongodb-user
Thanks for your response.

Had a bit of confusion with the docs, got it now.
thought -db was the db to restore from not the db to restore to.

So finally we found this was the command:
mongorestore --db=destination_db_name --username=user --password=pass
untared_backup_folder/dbname
Reply all
Reply to author
Forward
0 new messages