'Mongodb upgrade collections now missing
I've very very new to Mongodb so apologies if this is a stupid question.
I installed Mongodb and played around with creating some collections etc. I then wanted to try some aggregate functions but discovered I needed to upgrade.
I upgraded with homebrew, the upgrade seemed to work fine, but when I fire up mongod and mongo I can't see my collections anymore. I've tried to fire up mongod with the --upgrade option but still no joy. When I call 'show dbs' it shows that my test db is empty.
Curious as to what's happened here and how I can recover the collections.
Solution 1:[1]
losing databases after upgrading mongodb to newer version: Maybe it's too late to answer this 9 years old question. but i faced exactly the same issue last night. i lost all of my databases with more than one month working on them.i had multiple backups but never backed up in structured directory. so maybe beginners like me someday need to find a way to get rid of the issue. soloution: after upgrading mongodb to newer version , mongodb windows service executable path switchs to path of newer version executable path.the newer version only looks to new databases path. so if you want to have access to older version mongodb databases on localhost , you simply should change the path of mongodb windows service executable path to older version directory in "c:\program files\mongodb\server<version directory>\bin\mongod.exe"
after that, start service again , run mongodb and connect to local host . perform show dbs command . disappeared database should be there!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Meelad Ghazipour |
