How to recover mongoDB after improper shutdown
How to recover mongoDB after improper shutdown
Hi friends,
After several hours, I opened up my mongoDB project to find out that the db was crashed. I was pretty scared because of the wise words said on stackoverflow:
NoSQL is new and if any disaster occurs, your data is at the mercy of your developer
Oh boy! I started looking out the internet and finally found that I need to start the instance with repair option and specify the new database storage path:
c:\Program Files\MongoDB\Server\3.0\bin>mongod.exe --dbpath=c:\data\db --repair --repairpath=c:\data\db0
where, db0 is new recovery location. If I don’t want to preserve data, simply omit the repairpath and start