Skip to content

Instantly share code, notes, and snippets.

@jestan
Created December 6, 2012 14:33
Show Gist options
  • Save jestan/4224839 to your computer and use it in GitHub Desktop.
Save jestan/4224839 to your computer and use it in GitHub Desktop.
Mongo DB Repair
Mongo DB Repair
1) Remove mongod.pid file or mongod.lock file
2) Run './mongod --repair --dbpath <db-path>'
3) Run './mongo'
//From Mongo Shell
> db.repairDatabase();
//Checking Data Integrity
> use <db-name>;
> db.<collection-name>.validate();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment