From a26840f4874e214f1e042807b43a07a0224a4958 Mon Sep 17 00:00:00 2001 From: Bob Grabar Date: Wed, 12 Sep 2012 15:59:13 -0400 Subject: [PATCH 1/3] SERVER-6961 2.2 release notes update re mongodump --- source/release-notes/2.2.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/source/release-notes/2.2.txt b/source/release-notes/2.2.txt index c667840fb5d..a98b5b5f6ef 100644 --- a/source/release-notes/2.2.txt +++ b/source/release-notes/2.2.txt @@ -256,6 +256,23 @@ document, e.g. ``{ }``. See: :issue:`SERVER-6226`. +A Version-2.2 ``mongodump`` Cannot be Restored to a Pre-2.2 Database +```````````````````````````````````````````````````````````````````` + +A :program:`mongodump` performed in version 2.2 cannot be imported to +previous versions as doing so results lost indexes. If you are running +an earlier-version database (for example a version-2.0 database), you +cannot perform a :program:`mongorestore` on data from a version 2.2 +:program:`mongodump`. + +In version 2.2, :program:`mongodump` does not create a +system.indexes.bson for each database. The pre-2.2 +:program:`mongorestore` will not retain indexes that existed in the +dumped database. + +.. Do we want to include a link to the ticket? +.. See: :issue:`SERVER-6961`. + Behavioral Changes ~~~~~~~~~~~~~~~~~~ From 8438d4bcfe633e61ca86ec78a192ed08bc1f0154 Mon Sep 17 00:00:00 2001 From: Bob Grabar Date: Wed, 12 Sep 2012 17:21:22 -0400 Subject: [PATCH 2/3] SERVER-6961 DOCS-455 mongodump and mongorestore documentation --- source/administration/backups.txt | 2 ++ .../note-mongodump-compatibility-2.2.rst | 5 +++++ source/reference/mongodump.txt | 2 ++ source/reference/mongorestore.txt | 20 +++++++++++++---- source/release-notes/2.2.txt | 22 ++++++------------- 5 files changed, 32 insertions(+), 19 deletions(-) create mode 100644 source/includes/note-mongodump-compatibility-2.2.rst diff --git a/source/administration/backups.txt b/source/administration/backups.txt index 045813b8ce6..f6317fa99bd 100644 --- a/source/administration/backups.txt +++ b/source/administration/backups.txt @@ -426,6 +426,8 @@ the local database instance (e.g. ``127.0.0.1`` or ``localhost``) and create a database backup in a in the current directory named ``dump/``. +.. include:: /includes/note-mongodump-compatibility-2.2.rst + You can specify database and collection as options to the :program:`mongodump` command to limit the amount of data included in the database dump. For example: diff --git a/source/includes/note-mongodump-compatibility-2.2.rst b/source/includes/note-mongodump-compatibility-2.2.rst new file mode 100644 index 00000000000..d2d3bce3a0d --- /dev/null +++ b/source/includes/note-mongodump-compatibility-2.2.rst @@ -0,0 +1,5 @@ +.. note:: + + If you use the :program:`mongodump` tool from the 2.2 distribution to + create a dump of a database, you can restore that dump only to a 2.2 + database. diff --git a/source/reference/mongodump.txt b/source/reference/mongodump.txt index f49bb4a338a..a549cc085ae 100644 --- a/source/reference/mongodump.txt +++ b/source/reference/mongodump.txt @@ -15,6 +15,8 @@ effective :doc:`backup strategy `. Use in conjunction with :program:`mongorestore` to provide restore functionality. +.. include:: /includes/note-mongodump-compatibility-2.2.rst + .. seealso:: ":program:`mongorestore`" and ":doc:`/administration/backups`". Options diff --git a/source/reference/mongorestore.txt b/source/reference/mongorestore.txt index c0ec6150d0e..96d20e893f8 100644 --- a/source/reference/mongorestore.txt +++ b/source/reference/mongorestore.txt @@ -9,9 +9,21 @@ Synopsis -------- -The :program:`mongorestore` utility provides the ability to import content -from binary database dump into a specific database. This is the -inverse functionality of :program:`mongodump`. +The :program:`mongorestore` tool imports content from binary database +dump into a specific database. :program:`mongorestore` can import +content to an existing database or create a new one. + +Specifically, :program:`mongorestore` takes the output from +:program:`mongodump` and restores it. :program:`mongorestore` creates +indexes on a restore. :program:`mongorestore` performs only inserts. If +existing data with the same ``_id`` already exists on the database, +:program:`mongorestore` will not replace it. + +The :program:`mongorestore` tool does "fire-n-forget" writes. This means +that any errors that might happen during inserts are recorded only on +the server logs and not reported in the tool. + +.. include:: /includes/note-mongodump-compatibility-2.2.rst Options ------- @@ -32,7 +44,7 @@ Options .. option:: --version - Returns the version of the :program:`mongorestore` utility. + Returns the version of the :program:`mongorestore` tool. .. option:: --host <:port> diff --git a/source/release-notes/2.2.txt b/source/release-notes/2.2.txt index a98b5b5f6ef..6fbd3ba2572 100644 --- a/source/release-notes/2.2.txt +++ b/source/release-notes/2.2.txt @@ -254,24 +254,16 @@ running as upserts will only output a ``null`` value. Previously, in version 2.0 these operations would return an empty document, e.g. ``{ }``. -See: :issue:`SERVER-6226`. +See: :issue:`SERVER-6226` for more information. -A Version-2.2 ``mongodump`` Cannot be Restored to a Pre-2.2 Database -```````````````````````````````````````````````````````````````````` - -A :program:`mongodump` performed in version 2.2 cannot be imported to -previous versions as doing so results lost indexes. If you are running -an earlier-version database (for example a version-2.0 database), you -cannot perform a :program:`mongorestore` on data from a version 2.2 -:program:`mongodump`. +``mongodump`` Can Restore Only to a 2.2 Database +```````````````````````````````````````````````` -In version 2.2, :program:`mongodump` does not create a -system.indexes.bson for each database. The pre-2.2 -:program:`mongorestore` will not retain indexes that existed in the -dumped database. +If you use the :program:`mongodump` tool from the 2.2 distribution to +create a dump of a database, you may only restore that dump to a 2.2 +database. -.. Do we want to include a link to the ticket? -.. See: :issue:`SERVER-6961`. +See: :issue:`SERVER-6961` for more information. Behavioral Changes ~~~~~~~~~~~~~~~~~~ From 9fe6bb139494488daf1290e055a459efd8ed4823 Mon Sep 17 00:00:00 2001 From: Bob Grabar Date: Wed, 12 Sep 2012 17:23:56 -0400 Subject: [PATCH 3/3] SERVER-6961 DOCS-455 minor edit --- source/reference/mongorestore.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/reference/mongorestore.txt b/source/reference/mongorestore.txt index 96d20e893f8..f5a7eabce66 100644 --- a/source/reference/mongorestore.txt +++ b/source/reference/mongorestore.txt @@ -19,9 +19,9 @@ indexes on a restore. :program:`mongorestore` performs only inserts. If existing data with the same ``_id`` already exists on the database, :program:`mongorestore` will not replace it. -The :program:`mongorestore` tool does "fire-n-forget" writes. This means -that any errors that might happen during inserts are recorded only on -the server logs and not reported in the tool. +The :program:`mongorestore` tool does "fire-n-forget" inserts and does +not perform safe writes. Any errors that might happen during inserts are +recorded only on the server logs and not reported in the tool. .. include:: /includes/note-mongodump-compatibility-2.2.rst