[SERVER-317] Copy a single collection from DB1 to DB2 Created: 25/Sep/09 Updated: 12/Jul/16 Resolved: 30/Sep/09 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Tools |
| Affects Version/s: | 1.0.0 |
| Fix Version/s: | 1.1.2 |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Oliver Eilhard | Assignee: | Michael Dirolf |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Mac OS X |
||
| Participants: |
| Description |
|
With the current mongodump/mongorestore, it's not possible to copy just one collection from one database to another I expected to do something like this, but unfortunately mongorestore does a) always use the original DB although I specified the target DB with the -d option (I heard the nightly builds behave different) and I thought I could copy over one collection to another DB with something like this: pinocchio:~ oliver$ mongodump -d services -c suppliers -o tmp/dump pinocchio:~ oliver$ mongorestore -d services_dev -c suppliers --dir |
| Comments |
| Comment by Michael Dirolf [ 25/Sep/09 ] |
|
this will work as you described it - as long as you only dump a single collection (or specify a path to a single collection's .bson file to restore) you should be fine. note to restore to a different db you still need to be on a nightly build, not 1.0 |