From 6f75f3461b11c56c1d8101f89aab1b9d39f1b105 Mon Sep 17 00:00:00 2001 From: jason-price-mongodb Date: Tue, 21 May 2024 10:31:16 -0700 Subject: [PATCH 01/21] DOCSP-39421-detailed-extras --- source/mongodump.txt | 57 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/source/mongodump.txt b/source/mongodump.txt index 59c7c52d..f3e80389 100644 --- a/source/mongodump.txt +++ b/source/mongodump.txt @@ -60,6 +60,63 @@ Run ``mongodump`` from the system command line, not the .. include:: /includes/fact-online-archive-callout.rst +``mongodump`` exports data from collections, along with collection +options and index definitions. Optionally, ``mongodump`` can export +writes that occur while the export is ongoing. + +``mongodump`` exports data to a directory or an archive. + +Directory Export +~~~~~~~~~~~~~~~~ + +For a directory export: + +- ``mongodump`` has a root directory where the exported data is + stored. By default, the root directory is called ``dump`` but you can set + the name using the ``--out`` option. +- ``mongodump`` creates one subdirectory in the root directory for each + database. +- Inside each database directory mongodump creates a .metadata.json file + for each collection. If the collection is called foo, the file will be + foo.metadata.json. This file contains an Extended JSON (v2) document + which describes the options and indexes of the collection. +- Regular collections will also have a BSON file containing all the + documents dumped for the collection. +- A view will only have a .metadata.json file and will not have a BSON + file. + +Example directory dump structure: + +.. code-block:: none + + dump + ├── db1 + │ ├── coll1.bson + │ ├── coll1.metadata.json + │ └── view1.metadata.json + ├── db2 + │ ├── coll1.bson + │ ├── coll1.metadata.json + │ └── view1.metadata.json + └── oplog.bson + +If the dump was created with the --gzip option, then the bson files and +the .metadata.json files will be gzipped. Their extensions will be +.bson.gz and .metadata.json.gz. + +Archive Export +~~~~~~~~~~~~~~ + +For an archive export: + +Archive dumps are binary files in a custom MongoDB format. It is +possible to edit archives. However, editing archives is prone to error +and you could accidentally corrupt your archive. We recommend reaching +out to MongoDB Support if you need to edit your archive file. + +:option:`--out=, -o=` +:option:`--archive=` + Syntax ------ From 8fcd29c843d440d760818f08a0e4e4377df53a08 Mon Sep 17 00:00:00 2001 From: jason-price-mongodb Date: Tue, 21 May 2024 11:00:25 -0700 Subject: [PATCH 02/21] DOCSP-39421-detailed-extras --- source/mongodump.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/mongodump.txt b/source/mongodump.txt index f3e80389..57bf762e 100644 --- a/source/mongodump.txt +++ b/source/mongodump.txt @@ -114,8 +114,8 @@ possible to edit archives. However, editing archives is prone to error and you could accidentally corrupt your archive. We recommend reaching out to MongoDB Support if you need to edit your archive file. -:option:`--out=, -o=` -:option:`--archive=` +:option:`--out ` +:option:`--archive ` Syntax ------ From 21da8b3b0d82635a9b125e15877764616970011c Mon Sep 17 00:00:00 2001 From: jason-price-mongodb Date: Tue, 21 May 2024 14:25:25 -0700 Subject: [PATCH 03/21] DOCSP-39421-detailed-extras --- source/mongodump.txt | 51 ++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 28 deletions(-) diff --git a/source/mongodump.txt b/source/mongodump.txt index 57bf762e..cedf3a1a 100644 --- a/source/mongodump.txt +++ b/source/mongodump.txt @@ -66,26 +66,26 @@ writes that occur while the export is ongoing. ``mongodump`` exports data to a directory or an archive. -Directory Export -~~~~~~~~~~~~~~~~ +Export Data to a Directory +~~~~~~~~~~~~~~~~~~~~~~~~~~ For a directory export: -- ``mongodump`` has a root directory where the exported data is - stored. By default, the root directory is called ``dump`` but you can set - the name using the ``--out`` option. +- ``mongodump`` has a root directory where the exported data is stored. + By default, the root directory is called ``dump`` but you can set the + name using the ``mongodump`` :option:`--out ` + option. - ``mongodump`` creates one subdirectory in the root directory for each database. -- Inside each database directory mongodump creates a .metadata.json file - for each collection. If the collection is called foo, the file will be - foo.metadata.json. This file contains an Extended JSON (v2) document - which describes the options and indexes of the collection. -- Regular collections will also have a BSON file containing all the - documents dumped for the collection. -- A view will only have a .metadata.json file and will not have a BSON - file. +- Each database directory ``mongodump`` creates a .metadata.json file for + each collection. If the collection is called ``sales``, the file will + be ``sales.metadata.json`. The file has an Extended JSON (v2) document + with details for the collection options and indexes. +- Collections also have a BSON file containing all the + documents stored by the collection. +- A view only has a .metadata.json file and doesn't have a BSON file. -Example directory dump structure: +Example directory export structure: .. code-block:: none @@ -100,22 +100,17 @@ Example directory dump structure: │ └── view1.metadata.json └── oplog.bson -If the dump was created with the --gzip option, then the bson files and -the .metadata.json files will be gzipped. Their extensions will be -.bson.gz and .metadata.json.gz. +If you use the ``mongodump`` :option:`--gzip ` option, +the BSON files and the ``.metadata.json`` files are compressed using +``gzip``. The file extensions are ``.bson.gz`` and +``.metadata.json.gz``. -Archive Export -~~~~~~~~~~~~~~ +Export Data to an Archive File +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -For an archive export: - -Archive dumps are binary files in a custom MongoDB format. It is -possible to edit archives. However, editing archives is prone to error -and you could accidentally corrupt your archive. We recommend reaching -out to MongoDB Support if you need to edit your archive file. - -:option:`--out ` -:option:`--archive ` +To export data to an archive file, use the ``mongodump`` +:option:`--archive ` option. ``mongodump`` creates +a custom MongoDB format binary file. Syntax ------ From 281c13bb5bc2450692a2bbde9957834f09daa2ce Mon Sep 17 00:00:00 2001 From: jason-price-mongodb Date: Tue, 21 May 2024 16:05:35 -0700 Subject: [PATCH 04/21] DOCSP-39421-detailed-extras --- source/mongodump.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/source/mongodump.txt b/source/mongodump.txt index cedf3a1a..ca3e12cc 100644 --- a/source/mongodump.txt +++ b/source/mongodump.txt @@ -60,9 +60,14 @@ Run ``mongodump`` from the system command line, not the .. include:: /includes/fact-online-archive-callout.rst -``mongodump`` exports data from collections, along with collection -options and index definitions. Optionally, ``mongodump`` can export -writes that occur while the export is ongoing. +``mongodump`` exports: + +- Collection data +- Collection options +- Index definitions + +Optionally, ``mongodump`` can export writes that occur while the export +is ongoing. ``mongodump`` exports data to a directory or an archive. From afbb89797cbdda725e9dceb97036105ab43cb14f Mon Sep 17 00:00:00 2001 From: jason-price-mongodb Date: Tue, 21 May 2024 17:18:37 -0700 Subject: [PATCH 05/21] DOCSP-39421-detailed-extras --- source/mongodump.txt | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/source/mongodump.txt b/source/mongodump.txt index ca3e12cc..7d297b3b 100644 --- a/source/mongodump.txt +++ b/source/mongodump.txt @@ -76,32 +76,36 @@ Export Data to a Directory For a directory export: -- ``mongodump`` has a root directory where the exported data is stored. - By default, the root directory is called ``dump`` but you can set the - name using the ``mongodump`` :option:`--out ` - option. -- ``mongodump`` creates one subdirectory in the root directory for each +- ``mongodump`` has a root directory where the exported files are stored + in subdirectories. By default, the root directory is named ``dump`` + and is created in the directory where you run ``mongodump``, but you + can set the name with the ``mongodump`` :option:`--out ` option. +- ``mongodump`` creates a subdirectory in the root directory for each database. -- Each database directory ``mongodump`` creates a .metadata.json file for - each collection. If the collection is called ``sales``, the file will - be ``sales.metadata.json`. The file has an Extended JSON (v2) document - with details for the collection options and indexes. -- Collections also have a BSON file containing all the - documents stored by the collection. -- A view only has a .metadata.json file and doesn't have a BSON file. - -Example directory export structure: +- Each database directory contains a ``.metadata.json`` file for each + collection. For example, if the collection is ``sales``, the file is + ``sales.metadata.json`. The BSON file is an Extended JSON (v2) format + file, and contains a document with the exported collection options and + indexes. +- Each collection also has a corresponding BSON file with the collection + documents. +- A view only has a ``.metadata.json`` file and doesn't have a BSON + file. +- op log file XXX + +Example directory export structure and files: .. code-block:: none dump - ├── db1 - │ ├── coll1.bson - │ ├── coll1.metadata.json + ├── database1 + │ ├── collection1.bson + │ ├── collection2.metadata.json │ └── view1.metadata.json - ├── db2 - │ ├── coll1.bson - │ ├── coll1.metadata.json + ├── database2 + │ ├── collection1.bson + │ ├── collection2.metadata.json │ └── view1.metadata.json └── oplog.bson From 0aaa1f1da9a14765fd9f3cc9392cb9ab62908e46 Mon Sep 17 00:00:00 2001 From: jason-price-mongodb Date: Wed, 22 May 2024 10:57:40 -0700 Subject: [PATCH 06/21] DOCSP-39421-detailed-extras --- source/mongodump.txt | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/source/mongodump.txt b/source/mongodump.txt index 7d297b3b..352281f0 100644 --- a/source/mongodump.txt +++ b/source/mongodump.txt @@ -60,14 +60,11 @@ Run ``mongodump`` from the system command line, not the .. include:: /includes/fact-online-archive-callout.rst -``mongodump`` exports: +``mongodump`` can export: -- Collection data -- Collection options +- Collection documents, metadata, and options - Index definitions - -Optionally, ``mongodump`` can export writes that occur while the export -is ongoing. +- Writes that occur during the export ``mongodump`` exports data to a directory or an archive. @@ -76,18 +73,18 @@ Export Data to a Directory For a directory export: -- ``mongodump`` has a root directory where the exported files are stored - in subdirectories. By default, the root directory is named ``dump`` - and is created in the directory where you run ``mongodump``, but you - can set the name with the ``mongodump`` :option:`--out ` option. +- ``mongodump`` stores the exported files in a root directory that + contains subdirectories. By default, the root directory is named + ``dump`` and is created in the directory where you run ``mongodump``, + but you can set the root directory name with the ``mongodump`` + :option:`--out ` option. - ``mongodump`` creates a subdirectory in the root directory for each database. - Each database directory contains a ``.metadata.json`` file for each - collection. For example, if the collection is ``sales``, the file is - ``sales.metadata.json`. The BSON file is an Extended JSON (v2) format - file, and contains a document with the exported collection options and - indexes. + collection. For example, if a collection is named ``sales``, the + metadata file is ``sales.metadata.json`. The BSON file is an Extended + JSON v2 formatted file, and contains a document with the exported + collection metadata, options, and indexes. - Each collection also has a corresponding BSON file with the collection documents. - A view only has a ``.metadata.json`` file and doesn't have a BSON From 0a7b0362a8e9d296424c565c84d0619e27781d0c Mon Sep 17 00:00:00 2001 From: jason-price-mongodb Date: Wed, 22 May 2024 11:38:09 -0700 Subject: [PATCH 07/21] DOCSP-39421-detailed-extras --- source/mongodump.txt | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/source/mongodump.txt b/source/mongodump.txt index 352281f0..fa7f5733 100644 --- a/source/mongodump.txt +++ b/source/mongodump.txt @@ -71,25 +71,25 @@ Run ``mongodump`` from the system command line, not the Export Data to a Directory ~~~~~~~~~~~~~~~~~~~~~~~~~~ -For a directory export: - -- ``mongodump`` stores the exported files in a root directory that - contains subdirectories. By default, the root directory is named - ``dump`` and is created in the directory where you run ``mongodump``, - but you can set the root directory name with the ``mongodump`` - :option:`--out ` option. -- ``mongodump`` creates a subdirectory in the root directory for each - database. -- Each database directory contains a ``.metadata.json`` file for each - collection. For example, if a collection is named ``sales``, the +For a directory export, ``mongodump`` creates: + +- A root directory. By default, the root directory is named ``dump`` and + is created in the directory where you run ``mongodump``, but you can + set the root directory name with the ``mongodump`` :option:`--out + ` option. +- A subdirectory in the root directory for each database. +- A ``.metadata.json`` file for each collection in each database + directory. For example, if a collection is named ``sales``, the metadata file is ``sales.metadata.json`. The BSON file is an Extended JSON v2 formatted file, and contains a document with the exported collection metadata, options, and indexes. -- Each collection also has a corresponding BSON file with the collection - documents. -- A view only has a ``.metadata.json`` file and doesn't have a BSON +- A corresponding BSON file with the collection documents for each + collection. +- A ``.metadata.json`` file for each view. A view doesn't have a BSON file. -- op log file XXX +- CAn optional :term:`oplog` ``oplog.bson`` file, located in the root + directory, which contains write operations that occur during the + ``mongodump`` run. Example directory export structure and files: @@ -107,8 +107,8 @@ Example directory export structure and files: └── oplog.bson If you use the ``mongodump`` :option:`--gzip ` option, -the BSON files and the ``.metadata.json`` files are compressed using -``gzip``. The file extensions are ``.bson.gz`` and +the BSON files and ``.metadata.json`` files are compressed using +``gzip``. The exported file extensions are ``.bson.gz`` and ``.metadata.json.gz``. Export Data to an Archive File From 2caadd4b066a71b4caf1a4e927c94cb097eb81e5 Mon Sep 17 00:00:00 2001 From: jason-price-mongodb Date: Wed, 22 May 2024 14:11:45 -0700 Subject: [PATCH 08/21] DOCSP-39421-detailed-extras --- source/mongodump.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/mongodump.txt b/source/mongodump.txt index fa7f5733..f6e4ddba 100644 --- a/source/mongodump.txt +++ b/source/mongodump.txt @@ -87,7 +87,7 @@ For a directory export, ``mongodump`` creates: collection. - A ``.metadata.json`` file for each view. A view doesn't have a BSON file. -- CAn optional :term:`oplog` ``oplog.bson`` file, located in the root +- An optional :term:`oplog` ``oplog.bson`` file, located in the root directory, which contains write operations that occur during the ``mongodump`` run. From 570b224075fed2922c1517918ef2cd57c69cadbc Mon Sep 17 00:00:00 2001 From: jason-price-mongodb Date: Wed, 22 May 2024 14:17:51 -0700 Subject: [PATCH 09/21] DOCSP-39421-detailed-extras --- source/mongodump.txt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/source/mongodump.txt b/source/mongodump.txt index f6e4ddba..40ca0e6d 100644 --- a/source/mongodump.txt +++ b/source/mongodump.txt @@ -79,8 +79,8 @@ For a directory export, ``mongodump`` creates: ` option. - A subdirectory in the root directory for each database. - A ``.metadata.json`` file for each collection in each database - directory. For example, if a collection is named ``sales``, the - metadata file is ``sales.metadata.json`. The BSON file is an Extended + directory. For example, if a collection name is ``sales``, the + metadata file is ``sales.metadata.json`. The file is an extended JSON v2 formatted file, and contains a document with the exported collection metadata, options, and indexes. - A corresponding BSON file with the collection documents for each @@ -88,7 +88,7 @@ For a directory export, ``mongodump`` creates: - A ``.metadata.json`` file for each view. A view doesn't have a BSON file. - An optional :term:`oplog` ``oplog.bson`` file, located in the root - directory, which contains write operations that occur during the + directory, which contains write operations that occurred during the ``mongodump`` run. Example directory export structure and files: @@ -107,9 +107,8 @@ Example directory export structure and files: └── oplog.bson If you use the ``mongodump`` :option:`--gzip ` option, -the BSON files and ``.metadata.json`` files are compressed using -``gzip``. The exported file extensions are ``.bson.gz`` and -``.metadata.json.gz``. +the BSON files and JSON metadata files are compressed using ``gzip``. +The exported file extensions are ``.bson.gz`` and ``.metadata.json.gz``. Export Data to an Archive File ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 770ee61fee319b6f9e40c07fee936f14f80feef7 Mon Sep 17 00:00:00 2001 From: jason-price-mongodb Date: Wed, 22 May 2024 14:33:38 -0700 Subject: [PATCH 10/21] DOCSP-39421-detailed-extras --- source/mongodump.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/mongodump.txt b/source/mongodump.txt index 40ca0e6d..c4bed930 100644 --- a/source/mongodump.txt +++ b/source/mongodump.txt @@ -80,7 +80,7 @@ For a directory export, ``mongodump`` creates: - A subdirectory in the root directory for each database. - A ``.metadata.json`` file for each collection in each database directory. For example, if a collection name is ``sales``, the - metadata file is ``sales.metadata.json`. The file is an extended + metadata file is ``sales.metadata.json``. The file is an extended JSON v2 formatted file, and contains a document with the exported collection metadata, options, and indexes. - A corresponding BSON file with the collection documents for each From 269d79032003682a46eb3c59ef396daac5b77c72 Mon Sep 17 00:00:00 2001 From: jason-price-mongodb Date: Wed, 22 May 2024 14:52:53 -0700 Subject: [PATCH 11/21] DOCSP-39421-detailed-extras --- source/mongodump.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/mongodump.txt b/source/mongodump.txt index c4bed930..2bdee20c 100644 --- a/source/mongodump.txt +++ b/source/mongodump.txt @@ -78,14 +78,14 @@ For a directory export, ``mongodump`` creates: set the root directory name with the ``mongodump`` :option:`--out ` option. - A subdirectory in the root directory for each database. -- A ``.metadata.json`` file for each collection in each database +- A ``metadata.json`` file for each collection in each database directory. For example, if a collection name is ``sales``, the metadata file is ``sales.metadata.json``. The file is an extended JSON v2 formatted file, and contains a document with the exported collection metadata, options, and indexes. - A corresponding BSON file with the collection documents for each collection. -- A ``.metadata.json`` file for each view. A view doesn't have a BSON +- A ``metadata.json`` file for each view. A view doesn't have a BSON file. - An optional :term:`oplog` ``oplog.bson`` file, located in the root directory, which contains write operations that occurred during the @@ -108,7 +108,8 @@ Example directory export structure and files: If you use the ``mongodump`` :option:`--gzip ` option, the BSON files and JSON metadata files are compressed using ``gzip``. -The exported file extensions are ``.bson.gz`` and ``.metadata.json.gz``. +The exported files have ``bson.gz`` and ``metadata.json.gz`` at the end +of the names. Export Data to an Archive File ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From e8c5a845d0198847450898dce80a6959bdcfdcad Mon Sep 17 00:00:00 2001 From: jason-price-mongodb Date: Wed, 22 May 2024 15:00:44 -0700 Subject: [PATCH 12/21] DOCSP-39421-detailed-extras --- source/mongodump.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/mongodump.txt b/source/mongodump.txt index 2bdee20c..80bfadf7 100644 --- a/source/mongodump.txt +++ b/source/mongodump.txt @@ -107,9 +107,8 @@ Example directory export structure and files: └── oplog.bson If you use the ``mongodump`` :option:`--gzip ` option, -the BSON files and JSON metadata files are compressed using ``gzip``. -The exported files have ``bson.gz`` and ``metadata.json.gz`` at the end -of the names. +the BSON files and JSON metadata files are compressed. The exported +files have ``bson.gz`` and ``metadata.json.gz`` at the end of the names. Export Data to an Archive File ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 991390a7c988c28ed0322832a6022c873a47cd12 Mon Sep 17 00:00:00 2001 From: jason-price-mongodb Date: Wed, 22 May 2024 15:50:44 -0700 Subject: [PATCH 13/21] DOCSP-39421-detailed-extras --- source/mongodump.txt | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/source/mongodump.txt b/source/mongodump.txt index 80bfadf7..121c6c7d 100644 --- a/source/mongodump.txt +++ b/source/mongodump.txt @@ -78,14 +78,14 @@ For a directory export, ``mongodump`` creates: set the root directory name with the ``mongodump`` :option:`--out ` option. - A subdirectory in the root directory for each database. -- A ``metadata.json`` file for each collection in each database - directory. For example, if a collection name is ``sales``, the - metadata file is ``sales.metadata.json``. The file is an extended - JSON v2 formatted file, and contains a document with the exported - collection metadata, options, and indexes. -- A corresponding BSON file with the collection documents for each - collection. -- A ``metadata.json`` file for each view. A view doesn't have a BSON +- A BSON file with documents for each collection. For example, if a + collection name is ``sales``, the BSON file is ``sales.bson``. +- A metadata JSON file for each collection in each database directory. + For example, a metadata ``sales.metadata.json`` file. The file + contains a document with the exported collection metadata, options, + and indexes. +- A metadata JSON file for each view. For example, a metadata + ``salesByMonthView.metadata.json`` file. A view doesn't have a BSON file. - An optional :term:`oplog` ``oplog.bson`` file, located in the root directory, which contains write operations that occurred during the @@ -96,19 +96,20 @@ Example directory export structure and files: .. code-block:: none dump - ├── database1 - │ ├── collection1.bson - │ ├── collection2.metadata.json - │ └── view1.metadata.json - ├── database2 - │ ├── collection1.bson - │ ├── collection2.metadata.json - │ └── view1.metadata.json + ├── easternSalesDatabase + │ ├── sales.bson + │ ├── sales.metadata.json + │ └── salesByMonthView.metadata.json + ├── westernSalesDatabase + │ ├── sales.bson + │ ├── sales.metadata.json + │ └── salesByMonthView.metadata.json └── oplog.bson If you use the ``mongodump`` :option:`--gzip ` option, -the BSON files and JSON metadata files are compressed. The exported -files have ``bson.gz`` and ``metadata.json.gz`` at the end of the names. +the BSON files and JSON metadata files are compressed. The compressed +exported files have ``bson.gz`` and ``metadata.json.gz`` at the end of +the names. Export Data to an Archive File ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 96b595046d9c57556c37e06abdf654a1ad2123c0 Mon Sep 17 00:00:00 2001 From: jason-price-mongodb Date: Wed, 22 May 2024 16:04:26 -0700 Subject: [PATCH 14/21] DOCSP-39421-detailed-extras --- source/mongodump.txt | 50 +++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/source/mongodump.txt b/source/mongodump.txt index 121c6c7d..d8d76ecb 100644 --- a/source/mongodump.txt +++ b/source/mongodump.txt @@ -62,22 +62,39 @@ Run ``mongodump`` from the system command line, not the ``mongodump`` can export: -- Collection documents, metadata, and options -- Index definitions -- Writes that occur during the export +- Collection documents, metadata, and options. +- Index definitions. +- Writes that occur during the export. -``mongodump`` exports data to a directory or an archive. +``mongodump`` exports data to a directory or a binary archive file. Export Data to a Directory ~~~~~~~~~~~~~~~~~~~~~~~~~~ +Example directory export structure and files: + +.. code-block:: none + + dump + ├── easternSalesDatabase + │ ├── sales.bson + │ ├── sales.metadata.json + │ └── salesByMonthView.metadata.json + ├── westernSalesDatabase + │ ├── sales.bson + │ ├── sales.metadata.json + │ └── salesByMonthView.metadata.json + └── oplog.bson + For a directory export, ``mongodump`` creates: - A root directory. By default, the root directory is named ``dump`` and is created in the directory where you run ``mongodump``, but you can set the root directory name with the ``mongodump`` :option:`--out ` option. -- A subdirectory in the root directory for each database. +- A subdirectory in the root directory for each database. For example, + if a database name is ``easternSalesDatabase``, the subdirectory name + is also ``easternSalesDatabase``. - A BSON file with documents for each collection. For example, if a collection name is ``sales``, the BSON file is ``sales.bson``. - A metadata JSON file for each collection in each database directory. @@ -91,32 +108,17 @@ For a directory export, ``mongodump`` creates: directory, which contains write operations that occurred during the ``mongodump`` run. -Example directory export structure and files: - -.. code-block:: none - - dump - ├── easternSalesDatabase - │ ├── sales.bson - │ ├── sales.metadata.json - │ └── salesByMonthView.metadata.json - ├── westernSalesDatabase - │ ├── sales.bson - │ ├── sales.metadata.json - │ └── salesByMonthView.metadata.json - └── oplog.bson - If you use the ``mongodump`` :option:`--gzip ` option, the BSON files and JSON metadata files are compressed. The compressed exported files have ``bson.gz`` and ``metadata.json.gz`` at the end of the names. -Export Data to an Archive File -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Export Data to a Binary Archive File +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -To export data to an archive file, use the ``mongodump`` +To export data to a binary archive file, use the ``mongodump`` :option:`--archive ` option. ``mongodump`` creates -a custom MongoDB format binary file. +a custom MongoDB formatted binary file that contains the archived data. Syntax ------ From ba8caf401462f9d31b30f90171c0a6d5b8da581b Mon Sep 17 00:00:00 2001 From: jason-price-mongodb Date: Wed, 22 May 2024 16:13:21 -0700 Subject: [PATCH 15/21] DOCSP-39421-detailed-extras --- source/mongodump.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/mongodump.txt b/source/mongodump.txt index d8d76ecb..a689342b 100644 --- a/source/mongodump.txt +++ b/source/mongodump.txt @@ -71,7 +71,7 @@ Run ``mongodump`` from the system command line, not the Export Data to a Directory ~~~~~~~~~~~~~~~~~~~~~~~~~~ -Example directory export structure and files: +Example ``mongodump`` directory export structure and files: .. code-block:: none From 11f47a6ba35b58886177da220545a537667def81 Mon Sep 17 00:00:00 2001 From: jason-price-mongodb Date: Wed, 22 May 2024 17:22:59 -0700 Subject: [PATCH 16/21] DOCSP-39421-detailed-extras --- source/mongodump.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/mongodump.txt b/source/mongodump.txt index a689342b..65d4c190 100644 --- a/source/mongodump.txt +++ b/source/mongodump.txt @@ -88,10 +88,8 @@ Example ``mongodump`` directory export structure and files: For a directory export, ``mongodump`` creates: -- A root directory. By default, the root directory is named ``dump`` and - is created in the directory where you run ``mongodump``, but you can - set the root directory name with the ``mongodump`` :option:`--out - ` option. +- A root directory with the default name ``dump``. You can set the name + with the ``mongodump`` :option:`--out ` option. - A subdirectory in the root directory for each database. For example, if a database name is ``easternSalesDatabase``, the subdirectory name is also ``easternSalesDatabase``. From 36a6804ca1974a9cd767f35e1f555686adc455fc Mon Sep 17 00:00:00 2001 From: jason-price-mongodb Date: Wed, 22 May 2024 17:23:34 -0700 Subject: [PATCH 17/21] DOCSP-39421-detailed-extras --- source/mongodump.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/mongodump.txt b/source/mongodump.txt index 65d4c190..3865e57b 100644 --- a/source/mongodump.txt +++ b/source/mongodump.txt @@ -116,7 +116,7 @@ Export Data to a Binary Archive File To export data to a binary archive file, use the ``mongodump`` :option:`--archive ` option. ``mongodump`` creates -a custom MongoDB formatted binary file that contains the archived data. +a binary file that contains the archived data. Syntax ------ From f21c16f5234c558fb68b770507e11c4cb6f10376 Mon Sep 17 00:00:00 2001 From: jason-price-mongodb Date: Wed, 22 May 2024 17:25:38 -0700 Subject: [PATCH 18/21] DOCSP-39421-detailed-extras --- source/mongodump.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/mongodump.txt b/source/mongodump.txt index 3865e57b..b1d15e9b 100644 --- a/source/mongodump.txt +++ b/source/mongodump.txt @@ -104,7 +104,8 @@ For a directory export, ``mongodump`` creates: file. - An optional :term:`oplog` ``oplog.bson`` file, located in the root directory, which contains write operations that occurred during the - ``mongodump`` run. + ``mongodump`` run. To output an ``oplog.bson`` file, use the + ``mongodump`` :option:`--oplog ` option. If you use the ``mongodump`` :option:`--gzip ` option, the BSON files and JSON metadata files are compressed. The compressed From 0aeaf8bb6f7eaad878a6fe5164f9b2e7b36cf3d7 Mon Sep 17 00:00:00 2001 From: jason-price-mongodb Date: Thu, 23 May 2024 09:40:34 -0700 Subject: [PATCH 19/21] DOCSP-39421-detailed-extras --- source/mongodump.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/mongodump.txt b/source/mongodump.txt index b1d15e9b..c5928fd9 100644 --- a/source/mongodump.txt +++ b/source/mongodump.txt @@ -60,11 +60,12 @@ Run ``mongodump`` from the system command line, not the .. include:: /includes/fact-online-archive-callout.rst -``mongodump`` can export: +``mongodump`` exports: - Collection documents, metadata, and options. - Index definitions. -- Writes that occur during the export. +- Writes that occur during the export, if run with the ``mongodump`` + :option:`--oplog ` option. ``mongodump`` exports data to a directory or a binary archive file. From aca7077d8d0c452ca9264f6e4b48462e1b895161 Mon Sep 17 00:00:00 2001 From: jason-price-mongodb Date: Fri, 31 May 2024 10:06:58 -0700 Subject: [PATCH 20/21] DOCSP-39421-detailed-extras --- source/mongodump.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/mongodump.txt b/source/mongodump.txt index c5928fd9..aedd34bd 100644 --- a/source/mongodump.txt +++ b/source/mongodump.txt @@ -60,14 +60,14 @@ Run ``mongodump`` from the system command line, not the .. include:: /includes/fact-online-archive-callout.rst -``mongodump`` exports: +``mongodump`` dumps: - Collection documents, metadata, and options. - Index definitions. - Writes that occur during the export, if run with the ``mongodump`` :option:`--oplog ` option. -``mongodump`` exports data to a directory or a binary archive file. +``mongodump`` dumps data to a directory or a binary archive file. Export Data to a Directory ~~~~~~~~~~~~~~~~~~~~~~~~~~ From 9f2a1c1f153a5f4ebad85f54d715e6682373f9ff Mon Sep 17 00:00:00 2001 From: jason-price-mongodb Date: Fri, 31 May 2024 10:13:52 -0700 Subject: [PATCH 21/21] DOCSP-39421-detailed-extras --- source/mongodump.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/source/mongodump.txt b/source/mongodump.txt index aedd34bd..36bfe6a8 100644 --- a/source/mongodump.txt +++ b/source/mongodump.txt @@ -69,10 +69,10 @@ Run ``mongodump`` from the system command line, not the ``mongodump`` dumps data to a directory or a binary archive file. -Export Data to a Directory -~~~~~~~~~~~~~~~~~~~~~~~~~~ +Dump Data to a Directory +~~~~~~~~~~~~~~~~~~~~~~~~ -Example ``mongodump`` directory export structure and files: +Example ``mongodump`` directory dump structure and files: .. code-block:: none @@ -87,7 +87,7 @@ Example ``mongodump`` directory export structure and files: │ └── salesByMonthView.metadata.json └── oplog.bson -For a directory export, ``mongodump`` creates: +For a directory dump, ``mongodump`` creates: - A root directory with the default name ``dump``. You can set the name with the ``mongodump`` :option:`--out ` option. @@ -113,10 +113,10 @@ the BSON files and JSON metadata files are compressed. The compressed exported files have ``bson.gz`` and ``metadata.json.gz`` at the end of the names. -Export Data to a Binary Archive File -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Dump Data to a Binary Archive File +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -To export data to a binary archive file, use the ``mongodump`` +To dump data to a binary archive file, use the ``mongodump`` :option:`--archive ` option. ``mongodump`` creates a binary file that contains the archived data.