Skip to content

Commit 54a9e3a

Browse files
authored
DOCSP-27508 Fix to mongorestore examples (#2739) (#2776)
* DOCSP-27508 Updates mongodump and mongorestore examples * Fixes build issue * Fixes build issue * Fixes build errors * Fixes build issue * Fixes build issue * Fixes per Jeff * Fixes per Dave
1 parent ad5d123 commit 54a9e3a

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

source/tutorial/backup-and-restore-tools.txt

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ Back Up and Restore with MongoDB Tools
66

77
.. default-domain:: mongodb
88

9-
10-
119
.. contents:: On this page
1210
:local:
1311
:backlinks: none
@@ -136,7 +134,7 @@ or -o <mongodump.--out>` option:
136134

137135
.. code-block:: bash
138136

139-
mongodump --out=/data/backup/
137+
mongodump --out=/opt/backup/mongodump-1
140138

141139
To limit the amount of data included in the database dump, you can
142140
specify :option:`--db <mongodump.--db>` and
@@ -182,7 +180,12 @@ Consider the following example:
182180

183181
.. code-block:: bash
184182

185-
mongodump --host=mongodb1.example.net --port=3017 --username=user --password="pass" --out=/opt/backup/mongodump-2013-10-24
183+
mongodump \
184+
--host=mongodb1.example.net \
185+
--port=3017 \
186+
--username=user \
187+
--password="pass" \
188+
--out=/opt/backup/mongodump-1
186189

187190
On any :binary:`~bin.mongodump` command you may, as above, specify username
188191
and password credentials to specify database authentication.
@@ -227,6 +230,7 @@ To use :binary:`~bin.mongorestore` to connect to an active
227230
:binary:`~bin.mongod`, use a command with the following prototype form:
228231

229232
.. code-block:: bash
233+
:copyable: false
230234

231235
mongorestore --port=<port number> <path to the backup>
232236

@@ -235,10 +239,10 @@ Consider the following example:
235239

236240
.. code-block:: bash
237241

238-
mongorestore dump-2013-10-25/
242+
mongorestore /opt/backup/mongodump-1
239243

240244
Here, :binary:`~bin.mongorestore` imports the database backup in
241-
the :file:`dump-2013-10-25` directory to the :binary:`~bin.mongod` instance
245+
the :file:`/opt/backup/mongodump-1` directory to the :binary:`~bin.mongod` instance
242246
running on the localhost interface on the default port ``27017``.
243247

244248
.. _backup-restore-oplogreplay:
@@ -288,7 +292,10 @@ If restoring to an instance that enforces access control, include the
288292

289293
.. code-block:: bash
290294

291-
mongorestore --host=mongodb1.example.net --port=3017 --username=user --authenticationDatabase=admin /opt/backup/mongodump-2013-10-24
292-
293-
295+
mongorestore \
296+
--host=mongodb1.example.net \
297+
--port=3017 \
298+
--username=user \
299+
--authenticationDatabase=admin \
300+
/opt/backup/mongodump-1
294301

0 commit comments

Comments
 (0)