Skip to content

Commit ec35789

Browse files
schmallisokay-kim
authored andcommitted
DOCSP-980: clarify oplogReplay behaviour for 3.4
1 parent 7087350 commit ec35789

File tree

1 file changed

+54
-17
lines changed

1 file changed

+54
-17
lines changed

source/includes/options-mongorestore.yaml

Lines changed: 54 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -234,27 +234,56 @@ directive: option
234234
args: null
235235
description: |
236236
After restoring the database dump, replays the :term:`oplog` entries
237-
from the :file:`oplog.bson` file located in the top level of the dump
238-
directory. When used in conjunction with :option:`mongodump --oplog`,
239-
:binary:`~bin.mongorestore --oplogReplay <mongorestore>`
237+
from a bson file.
238+
When used in conjunction with :option:`mongodump --oplog
239+
<--oplog>`, :binary:`~bin.mongorestore --oplogReplay <mongorestore>`
240240
restores the database to the point-in-time backup captured with the
241-
``mongodump --oplog`` command.
242-
241+
``mongodump --oplog`` command.
242+
243+
{{program}} searches for any valid source for the bson file
244+
in the following locations:
245+
246+
- The top level of the dump directory, as in the case of a dump created
247+
with :option:`mongodump --oplog <--oplog>`.
248+
249+
- The path specified by :option:`--oplogFile`.
250+
251+
- ``<dump-directory>/local/oplog.rs.bson``, as in the case of a dump
252+
of the ``oplog.rs`` collection in the ``local`` database
253+
on a :binary:`~bin.mongod` that is a member of a replica set.
254+
255+
- ``<dump-directory>/local/oplog.$main.bson``, as in the case of a dump
256+
of the ``oplog.rs`` collection in the ``local`` database
257+
on a :binary:`~bin.mongod` that uses master-slave replication.
258+
259+
If there is an ``oplog.bson`` file at the top level of the dump
260+
directory **and** a path specified by :option:`--oplogFile`,
261+
{{program}} returns an error.
262+
263+
If there is an ``oplog.bson`` file at the top level of the dump directory,
264+
{{program}} restores that file as the oplog. If there are also bson
265+
files in the ``dump/local`` directory, {{program}} restores them like
266+
normal collections.
267+
268+
If you specify an oplog file using :option:`--oplogFile`,
269+
{{program}} restores that file as the oplog. If there are also bson
270+
files in the ``dump/local`` directory, {{program}} restores them like
271+
normal collections.
272+
273+
If there is both an ``oplog.rs.bson`` and an ``oplog.$main.bson``
274+
file in the ``dump/local`` directory **and** there is no
275+
``oplog.bson`` file at the top level of the dump directory or file
276+
specified with :option:`--oplogFile`, {{program}} returns an error.
277+
243278
For an example of {{role}}, see :ref:`backup-restore-oplogreplay`.
244279
245-
:binary:`~bin.mongorestore --oplogReplay <mongorestore>` replays any
246-
valid :file:`oplog.bson` file found in the top level of the dump
247-
directory. That is, if you have a bson file that contains valid oplog
248-
entries, you can name the file ``oplog.bson`` and move it to the top
249-
level of the dump directory for :binary:`~bin.mongorestore --oplogReplay
250-
<mongorestore>` to replay.
251-
252280
.. note::
253281
254-
When using :binary:`~bin.mongorestore` with {{role}}, you must
255-
restore a full dump of a :term:`replica set` member created
256-
using :binary:`~bin.mongodump --oplog <mongodump>`.
257-
:binary:`~bin.mongorestore` with {{role}} fails if you use any of
282+
When using :binary:`~bin.mongorestore` with {{role}} to restore
283+
a replica set, you must
284+
restore a full dump of a :term:`replica set` member created
285+
using :binary:`~bin.mongodump --oplog <mongodump>`.
286+
:binary:`~bin.mongorestore` with {{role}} fails if you use any of
258287
the following options to limit the data be restored:
259288
260289
- :option:`--db`
@@ -418,7 +447,11 @@ description: |
418447
.. versionadded:: 3.2
419448
420449
Restores from compressed files or data stream created by
450+
<<<<<<< HEAD
421451
:binary:`mongodump --archive <bin.mongodump>`
452+
=======
453+
:binary:`~bin.mongodump --archive <mongodump>`
454+
>>>>>>> DOCSP-980: clarify oplogReplay behaviour for 3.4
422455

423456
To restore from a dump directory that contains compressed files, run
424457
:binary:`~bin.mongorestore` with the new ``--gzip`` option.
@@ -508,7 +541,11 @@ pre: |
508541
509542
description: |
510543
Specifies the path to the oplog file containing oplog data for the
511-
restore.
544+
restore. Use with :option:`--oplogReplay`.
545+
546+
If you specify {{role}} and there is an :file:`oplog.bson`
547+
file at the top level of the dump directory, {{program}} returns an
548+
error.
512549
optional: true
513550
---
514551
program: mongorestore

0 commit comments

Comments
 (0)