[SERVER-23488] mongorestore --db with --archive selects which database to restore Created: 04/Apr/16  Updated: 05/Apr/16  Resolved: 05/Apr/16

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

Type: Bug Priority: Minor - P4
Reporter: Tais Hansen Assignee: Kelsey Schubert
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to DOCS-7573 Clarify the behavior of mongorestore ... Closed
Operating System: ALL
Steps To Reproduce:

1. mongodump --host=onedatabase --archive --gzip --db=onedatabase | mongorestore --host=otherdatabase --archive --gzip --db=otherdatabase --drop
2. "otherdatabase" does not exist.

Participants:

 Description   
Original summary

mongorestore --db option not working as documented

Description

The documentation for mongorestore dictates that you use --db to specify which database to restore data into. However, if you ie. use mongodump --db=A and then mongorestore --db=B to restore, nothing will be created. You have to specify the same database name as used in the dump.



 Comments   
Comment by Kelsey Schubert [ 05/Apr/16 ]

Hi taisph,

Thanks for opening this ticket. The behavior you describe is expected when you use the {{--archive]] option. Please see the example in our documentation here. I understand how our documentation may be misleading, so I have opened DOCS-7573 to clarify this behavior. Please feel free to vote for DOCS-7573 and watch it for updates.

Kind regards,
Thomas

Generated at Thu Feb 08 04:03:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.