[DOCS-12579] mongorestore docs show deprecated example with --archive and --db Created: 28/Mar/19  Updated: 30/Oct/23  Resolved: 13/Jul/19

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Bug Priority: Major - P3
Reporter: Nic Cottrell Assignee: Kay Kim (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by DOCS-10480 Comment on: "manual/reference/program... Closed
is duplicated by DOCS-10706 mongorestore --db database --collecti... Closed
Related
related to DOCS-9954 Clarify what --nsInclude does exactly... Closed
related to TOOLS-1918 mongorestore from stdin demands colle... Accepted
is related to DOCS-7573 Clarify the behavior of mongorestore ... Closed
Participants:
Days since reply: 4 years, 30 weeks, 4 days ago
Epic Link: DOCSP-1769

 Description   

Description

In this section Restore from compressed data  

mongorestore --gzip --archive=test.20150715.gz --db test

which gives

2019-03-28T16:26:26.080+0100	the --db and --collection args should only be used when restoring from a BSON file. Other uses are deprecated and will not exist in the future; use --nsInclude instead

it feels like we should skip the --db part of the example, or is this a bug in mongorestore in 4.0?

Scope of changes

Impact to Other Docs

MVP (Work and Date)

Resources (Scope or Design Docs, Invision, etc.)



 Comments   
Comment by Githook User [ 13/Jul/19 ]

Author:

{'name': 'Kay Kim', 'email': 'kay.kim@10gen.com', 'username': 'kay-kim'}

Message: DOCS-7573,DOCS-12579: update output messages - different from 4.2
Branch: v3.4
https://github.com/mongodb/docs/commit/7d203dc30dbd0c3eca1b36c0f2c74dcc3fdada13

Comment by Githook User [ 13/Jul/19 ]

Author:

{'name': 'Kay Kim', 'email': 'kay.kim@10gen.com', 'username': 'kay-kim'}

Message: DOCS-7573,DOCS-12579: update mongorestore in prep for go changes
Branch: v3.4
https://github.com/mongodb/docs/commit/a58e342944ccb4e9f621a08766795dc150e6de12

Comment by Githook User [ 13/Jul/19 ]

Author:

{'name': 'Kay Kim', 'username': 'kay-kim', 'email': 'kay.kim@10gen.com'}

Message: DOCS-7573,DOCS-12579: update output messages - different from 4.2
Branch: v3.6
https://github.com/mongodb/docs/commit/40fd5f6c97a861e37a585a720d667ed22124d30c

Comment by Githook User [ 13/Jul/19 ]

Author:

{'name': 'Kay Kim', 'username': 'kay-kim', 'email': 'kay.kim@10gen.com'}

Message: DOCS-7573,DOCS-12579: update mongorestore in prep for go changes
Branch: v3.6
https://github.com/mongodb/docs/commit/c93d1431f85c927c1cb34d0163d7ca30c3c277d6

Comment by Githook User [ 13/Jul/19 ]

Author:

{'name': 'Kay Kim', 'username': 'kay-kim', 'email': 'kay.kim@10gen.com'}

Message: DOCS-7573,DOCS-12579: update output messages - different from 4.2
Branch: v4.0
https://github.com/mongodb/docs/commit/2bcb5d93d6577bc0da5c35232173198a19fb541a

Comment by Githook User [ 12/Jul/19 ]

Author:

{'name': 'Kay Kim', 'username': 'kay-kim', 'email': 'kay.kim@10gen.com'}

Message: DOCS-7573,DOCS-12579: update mongorestore in prep for go changes
Branch: v4.0
https://github.com/mongodb/docs/commit/86a076210a7c6ea07b5b194d7735712b412242cf

Comment by Githook User [ 12/Jul/19 ]

Author:

{'name': 'Kay Kim', 'username': 'kay-kim', 'email': 'kay.kim@10gen.com'}

Message: DOCS-7573,DOCS-12579: update mongorestore in prep for go changes
Branch: master
https://github.com/mongodb/docs/commit/0390bc4026820f752e42f07f42bad31c2f73624f

Comment by Patrick Freed [ 01/Apr/19 ]

The example in the ticket description here is working as intended and should be emitting a deprecation warning.

Restoring from an archive can be thought of as the same as restoring from a directory (we preserve the structure within the archive). When restoring from a directory, the subdirectories are named according to the collection they were dumped from. Additionally, there are metadata files that can also identify the namespaces that were dumped.

The db and collection options are only used when restoring an isolated .bson file since it lacks the directory structure and metadata file. In such a case, the user needs to provide a place for the data to go since it can't be inferred from context. When the required context does exist however, we use nsInclude instead to filter down the possible namespaces to restore.

In summary, -d and -c provide a destination to restore to when one cannot be inferred from what is being restored (i.e. raw .bson files or stdin without archive). nsInclude is used to choose namespaces to restore from among ones that can be found in a given dump (in a directory or archive).

The second example involving piping from stdin is indeed a bug and should not be emitting a warning, since mongorestore will be expecting raw bson from stdin without the aforementioned structure or metadata. If fact, -d and -c are required when reading from stdin without archive for this reason. Note that when using the archive option when reading from stdin, the deprecation warning should be emitted for the same reasons it's emitted when using archive and reading from disk.

This example is also deprecated for using -d with a directory based dump:

mongorestore --collection people --db accounts dump/

Comment by Patrick Freed [ 29/Mar/19 ]

We're currently in the process of rewriting most of the tools, and we have a catch all ticket (TOOLS-2218) that tracks the work of updating the docs to match.

I've already finished the work on mongorestore, so I'll take some time Monday to go through it and vet the current state of its docs.

Comment by David Golden [ 29/Mar/19 ]

patrick.freed, could you please help out on this, as you just worked on mongorestore?

Comment by Ravind Kumar (Inactive) [ 28/Mar/19 ]

We'll have to dig into this a bit, I think. Thanks for raising.

Generated at Thu Feb 08 08:05:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.