Uploaded image for project: 'MongoDB ETL Tools'
  1. MongoDB ETL Tools
  2. TOOLS-1234

mongorestore namespace renaming support

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3.11
    • Component/s: None
    • Labels:
      None
    • Documentation Changes:
      Needed
    • Case:

      Description

      There should be support for specific renaming of namespaces, for restoring from either archives and directory dumps. Currently, renaming isn't really possible with archives. With a directory dump, tinkering with the files can yield renaming, but isn't ideal.

      Overview of potential changes:

      • five new command line options:
        • '--nsExclude <ns-pattern>' excludes matching namespaces. Can be used in
          multiplicity.
        • '--nsInclude <ns-pattern>' includes matching namespaces. Can be used in
          multiplicity. Includes are processed before excludes, permitting their
          use in combination.
        • '--nsFrom <ns-pattern>' and '--nsTo <ns-pattern>' correspond to each
          other according to the order in which they are specified. Can be used in
          multiplicity.
        • '--dryRun' stops the program before any restoring begins.
      • deprecated options:
        • --db, --collection, --excludeCollection, --excludeCollectionsWithPrefix
      • namespace pattern: <ns-pattern>
        • permits includes/excludes/renames to refer to any namespace that
          matches a pattern comprised of wild cards, which match their smallest
          valid occurrence.
        • for all includes, all excludes, and simple replacements, asterisks may
          be used as wild cards. Replacements correspond linearly to matches.
          Literal asterisks and backslashes (*, \) must be backslash-escaped.
          • examples:
            • --nsFrom 'prod.*' --nsTo 'staging.*'
            • --nsFrom '*.user*' --nsTo '*.member*'
            • --nsExclude 'tests.*' --nsExclude '*.test*'
            • --nsInclude 'internal.*' --nsExclude '*.top_secret'
        • for more complex replacements, dollar sign-delimited wild cards can
          assign a matching variable in the form of '$var$'. Replacements do not
          need to be linear.
          • examples:
            • --nsFrom '$db$.user$stuff$' --nsTo 'user.$stuff$.$db$'
            • --nsFrom 'test_$stack$.$coll$' --nsTo 'recover.$stack$.$coll$'

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                lucas.morales Lucas Morales
                Reporter:
                lucas.morales Lucas Morales
              • Votes:
                3 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: