MongoDB version: 6.0.3
After an unexpected shutdown, the mongod service does able to start up, and we went to use mongod --repair to fix it. After the repair is done, the mongod service is able to start but there is no existing database inside. It became a fresh install of mongodb altho there are still a lot of collection wt files and index wt files inside data directory.
There are collection with 20+gb data but mongodb just does not recognise it.
Did tried a few other solution to recover data but none of them works.
Solution tried:
-
tried using work around of create new collection and replace with existing collection and do mongod repair. but the result is getting invariant failure error. (reference: https://medium.com/@imunscarred/repairing-mongodb-when-wiredtiger-wt-file-is-corrupted-9405978751b5)
-
salvage data from collection using wt tool version 11.1, end up stuck at last step which is dumping the collection always return cursor open failed: no such file or directory. (reference: Recovering a WiredTiger collection from a corrupt MongoDB installation | ALEX BEVILACQUA)
cursor open(table:./collection-0–3334788985743856927.wt) failed: No such file or directory
Is there anyway to recover data?