Reputation: 1781
Trying connect to a dev's environment MongoDB (3.6) ubuntu server fails, after digging around I've found the the MongoDB service crushed and fails to restart, getting the following error:
(code=exited, status=14)
Digging deeper into the logs the following error appears:
Unable to start up mongod due to missing featureCompatibilityVersion document.
Please run with --repair to restore the document.
Running mongod --repair
, seems the process finish successfully, but trying to start the service again still fails with the same error.
Is there a way to fix or get around it?
If not, is there maybe a way to export the data so I can reinstall mongo and import it to the new installation? I don't mind reinstalling mongo from scratch, just don't want to lost all the data.
Upvotes: 0
Views: 161
Reputation: 1781
Apparently the issue with the mongod --repair
was that the service and the command looked at different dbpath
.
Specifying the --dbpath
flag to the --repair
command fixed the issue :)
Upvotes: 1