[DOCS-10704] Add example for renaming a database to mongodump/mongorestore Created: 22/Aug/17  Updated: 30/Oct/23

Status: Closed
Project: Documentation
Component/s: tools
Affects Version/s: 3.4.7
Fix Version/s: Server_Docs_20231030

Type: Improvement Priority: Major - P3
Reporter: Torsten Spindler Assignee: Unassigned
Resolution: Won't Do Votes: 1
Labels: docs-triage, mongorestore
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 1 year, 14 weeks, 2 days ago

 Description   

Please provide an example to rename a database with a pipe between mongodump and mongorestore.

The use of --nsFrom "sourceDatabase.*" --nsTo "destDatabase.* to copy all collections from sourceDatabase and rename them to destDatabase is not that easy to see in mongorestore. The --db option cannot be used, as the restore comes from a pipe, not a file.

Can an authoritative example on how to copy and rename a database with mongodump / mongorestore be added to:
https://docs.mongodb.com/manual/reference/program/mongodump/#examples



 Comments   
Comment by Education Bot [ 31/Oct/22 ]

Hello! This ticket has been closed due to inactivity. If you believe this ticket is still important, please reopen it and leave a comment to explain why. Thank you!

Comment by Torsten Spindler [ 22/Aug/17 ]

I double checked the mongodump and mongorestore pages and it seems in "Change Collections’ Namespaces during Restore" example we already almost cover the same example. However, while the existing example is great at showing the flexibility of the new options, I think there's room for improvement by adding the more simple copy collection to a new name example requested here. Please ignore the reference of the mongodump page, it should go to the mongorestore page.

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