@@ -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
141139To limit the amount of data included in the database dump, you can
142140specify :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
187190On any :binary:`~bin.mongodump` command you may, as above, specify username
188191and 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
240244Here, :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
242246running 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