Recovering a missing WiredTiger.wt

Em Jay picture Em Jay · Nov 30, 2016 · Viewed 8.8k times · Source

Is there a way to regenerate a missing WiredTiger.wt? Our MongoDB instance stopped working (bizarrely), and that file got missing from the dbpath folder—Seems like this behaviour is known.

BTW, the repair utility doesn't succeed:

file:WiredTiger.wt, connection: .//WiredTiger.wt: handle-open: open: No such file or directory

Losing the database is hard to stomach...

Any idea? Thanks.

P.S. We still got all the other .wt files.

Answer

Stennie picture Stennie · Nov 30, 2016

The WiredTiger.wt file includes essential metadata about a MongoDB data directory: which collections & indexes exist as well as the latest checkpoints in each of those files. If WiredTiger.wt has been completely removed from your dbPath there is currently no process or tool to recreate this metadata, short of restoring the full dbPath from a backup copy. While you do have data files, you've unfortunately lost the catalog describing what these files contain and how they relate.