tokumx

How to repair/show missing dbs list in TokuMX MongoDB that have files in dbpath?


I wanted to copy the data files (not mongodump) of one mongodb instance to another and here's the scenario:

  1. Shutdown MongoDB on Machine 1 and copied the db files to Machine 2
  2. Shutdown MongoDB on Machine 2
  3. Moved the copied data files from Machine 1 to the dbpath of MongoDB on Machine 2
  4. Started MongoDB on Machine 2

Now when I execute show dbs it doesn't list any of the dbs that were previously there and of course neither the db that has been copied.

Now that I know this doesn't work, I wanted to rollback the changes done on Machine 2. So I shutdown the instance, removed the copied files and restarted but I still don't see any of the dbs that were previously there. Tried to search everywhere on how to repair this to no avail. How can this be fixed?

Note: I tried the --repair parameter on mongod but it's depricated on TokuMX v1.4.1-mongodb-2.4.9


Solution

  • I've managed to restore the data by using mongodump with --dbpath which allowed me to create backups of dbs directly from the database files instead of the mongod server (the server has to be offline for this to work). Then I was able to use mongorestore to load the data to a new instance.

    I had to use mongodb-org instead of tokumx for this to work (with tokumx the dumps came out empty).