Iam creating a test environment on the same ubuntu server where my prod enviroment is hosted.
So i need to create a replica of the mongodb database iam using on the ubuntu server but add '_test' to the end of the name of the database. That is the reason i dont want to use mongodump.
what would happend if i export the prod db version and restore it on the same server with the same db name. Would it just override?
So to solve the problem i wanna export all the collection at ones and import all the collection at ones. Is it possible? If yes. How is this done? If no... does this mean i have to do an export/import command for every collection? This is do able for because i only have like 10 collections. Or is there a better way to solve my problem?
What does the mongodbexport.exe do? it came with the mongo db tools in the bin folder? when i execute it there seems like a metrics.interim was created. What is that?
You can only use
mongoimport
andmongoexport
on only one collection at a time.You could use some bash script to simplify the task
Something like this :