Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-23488

mongorestore --db with --archive selects which database to restore

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 3.2.0
    • Component/s: Tools
    • Labels:
      None
    • ALL
    • Hide

      1. mongodump --host=onedatabase --archive --gzip --db=onedatabase | mongorestore --host=otherdatabase --archive --gzip --db=otherdatabase --drop
      2. "otherdatabase" does not exist.

      Show
      1. mongodump --host=onedatabase --archive --gzip --db=onedatabase | mongorestore --host=otherdatabase --archive --gzip --db=otherdatabase --drop 2. "otherdatabase" does not exist.

      Original summary

      mongorestore --db option not working as documented

      Description

      The documentation for mongorestore dictates that you use --db to specify which database to restore data into. However, if you ie. use mongodump --db=A and then mongorestore --db=B to restore, nothing will be created. You have to specify the same database name as used in the dump.

            Assignee:
            kelsey.schubert@mongodb.com Kelsey Schubert
            Reporter:
            taisph Tais Hansen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: