I wanted to copy the data files (not mongodump) of one mongodb instance to another and here's the scenario:
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
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).