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

Undocumented mongorestore change for sharded systems

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.1.1
    • Affects Version/s: 3.0.0
    • Component/s: mongorestore
    • None
    • Kernel Tools Iteration 3.1.1

      The migration from the old tools to the newer Go-based tools has subtly changed the mongorestore behaviour for sharded systems. Previously, when making sure no "config" folder exists in your database dump you could restore to a sharded system. The new check removed the actual folder check and simply errors out when connecting to a mongos and running without a --db flag.

      You can see the change here:

      Old behaviour:
      https://github.com/mongodb/mongo/commit/5aa8ac2e82eaf2546bff2249cb717371f9ebae23

      New behaviour:
      https://github.com/mongodb/mongo-tools/blob/5bc150709ee66056636c5d39a9d628907632950f/mongorestore/mongorestore.go#L91

      Looking at that check it seems a workaround would be to iterate over all databases in the dump manually and running mongorestore multiple times with the --db option.

      I hope this was not an intentional change but if so the 3.0 changelog should clearly reflect this.

            Assignee:
            mikeo@mongodb.com Michael O'Brien
            Reporter:
            jeroenv Jeroen Vijfhuizen
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: