[DOCS-7573] Clarify the behavior of mongorestore --archive with --db or --collection options Created: 04/Apr/16 Updated: 30/Oct/23 Resolved: 13/Jul/19 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | manual, Server, tools |
| Affects Version/s: | None |
| Fix Version/s: | Server_Docs_20231030 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Kelsey Schubert | Assignee: | Kay Kim (Inactive) |
| Resolution: | Done | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Participants: | |||||||||||||
| Days since reply: | 4 years, 30 weeks, 4 days ago | ||||||||||||
| Epic Link: | DOCSP-1769 | ||||||||||||
| Description |
|
https://docs.mongodb.org/manual/reference/program/mongorestore/#cmdoption--db
However, as noted at https://docs.mongodb.org/manual/reference/program/mongorestore/#restore-a-database-from-an-archive-file --db is used to select which database is restored from the archive. If --db or --collection specifies a database or collection not contained in the dump archive no data will be restored:
I think this distinction should be highlighted as part of the description of the --db option quoted above. |
| Comments |
| Comment by Githook User [ 13/Jul/19 ] |
|
Author: {'name': 'Kay Kim', 'email': 'kay.kim@10gen.com', 'username': 'kay-kim'}Message: |
| Comment by Githook User [ 13/Jul/19 ] |
|
Author: {'name': 'Kay Kim', 'email': 'kay.kim@10gen.com', 'username': 'kay-kim'}Message: |
| Comment by Githook User [ 13/Jul/19 ] |
|
Author: {'name': 'Kay Kim', 'username': 'kay-kim', 'email': 'kay.kim@10gen.com'}Message: |
| Comment by Githook User [ 13/Jul/19 ] |
|
Author: {'name': 'Kay Kim', 'username': 'kay-kim', 'email': 'kay.kim@10gen.com'}Message: |
| Comment by Githook User [ 13/Jul/19 ] |
|
Author: {'name': 'Kay Kim', 'username': 'kay-kim', 'email': 'kay.kim@10gen.com'}Message: |
| Comment by Githook User [ 12/Jul/19 ] |
|
Author: {'name': 'Kay Kim', 'username': 'kay-kim', 'email': 'kay.kim@10gen.com'}Message: |
| Comment by Githook User [ 12/Jul/19 ] |
|
Author: {'name': 'Kay Kim', 'username': 'kay-kim', 'email': 'kay.kim@10gen.com'}Message: |
| Comment by Bijith Kumar [ 29/Jun/16 ] |
|
The verbose log also does not provide any error message or warning if you specify a new db name while restoring. Spent half a day debugging why my restore doesn't work. mongodump --host localhost --archive=myCollection.gz --gzip --db 'MyDB' --collection myCollection -vvvvvv mongorestore --gzip --archive=myCollection.gz --db MyDB_Restored -vvvvvvv 2016-06-29T14:33:05.214-0700 demux namespaceHeader: {MyDB myCollection true -6057897897989027830}2016-06-29T14:33:05.215-0700 demux checksum for namespace MyDB.myCollection is correct (-6057897897989027830), 87 bytes |