Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-857

mongorestore does not restore files, unless they are in a sub-directory.

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.0.5
    • Component/s: None
    • Labels:
      None
    • Needed

      Assume the mongodump files are located in testDB and these are the contents of that directory i.e. there are no subdirectories

      ls -lrt testDB/
      total 664
      -rw-r--r--  1 angushman-temp  staff      87 Jul 29 14:34 testColl.metadata.json
      -rw-r--r--  1 angsuhman-temp  staff  330000 Jul 29 14:34 testColl.bson
      -rw-r--r--  1 angsuhman-temp  staff      70 Jul 29 14:34 system.indexes.bson
      

      Then running mongod 3.0.5 and mongorestore 3.0.5 attempting to restore testDB directly does not work:

      angushman-temp$ mongorestore testDB/
      2015-07-29T14:36:23.472-0700	building a list of dbs and collections to restore from testDB/ dir
      2015-07-29T14:36:23.473-0700	don't know what to do with file "testDB/system.indexes.bson", skipping...
      2015-07-29T14:36:23.473-0700	don't know what to do with file "testDB/testColl.bson", skipping...
      2015-07-29T14:36:23.473-0700	don't know what to do with file "testDB/testColl.metadata.json", skipping...
      2015-07-29T14:36:23.473-0700	done
      

      With mongod 2.6.10 and mongorestore 2.6.10 on the other hand I am able to successfully restore.

      On 3.0.5 I can restore from the parent directory of testDB. So it looks like mongorestore in 3.0.5 is expecting two directory levels in order to restore.

            Assignee:
            gabriel.russell@mongodb.com Gabriel Russell (Inactive)
            Reporter:
            angshuman.bagchi@mongodb.com Angshuman Bagchi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: