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

Add option targetDb to mongorestore when use option --archive

    • Type: Icon: Task Task
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: mongorestore

      When we use the option archive it could be nice to de-archive just one database inside another database which have a different name.

      The actual use case is this one:
      1. I have a mongo database created by a SaaS, this service give one database
      2. I dump this database as an archive (Archive is used because of the necessity to dump it as a stream using stdout)
      3. I want to restore my database to a new created database created from SaaS wich have a different database name than the original one
      4. I'm blocked cause it's not possible with --archive option when restoring, it wants to create a database with the name from the original database which is not possible to use

      Behavior of the option --targetDb in mongorestore:

      • this can only be used when using --archive option
      • This option make mongorestore to restore just one database at once
      • If you have more than one database in archive and user use --targetDb it will fail, in this case it will ask to set also the option --db
      • else mongorestore will take the only database set in archive and restore it in the database set in --targetDb

            Assignee:
            Unassigned Unassigned
            Reporter:
            ArthurHlt arthur halet [X]
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: