MongoDB Backup Recovery

Source: Internet
Author: User
Tags file copy

Note: In the backup file directory selection, there is a condition that the file directory, no matter how deep, can only have one file, (that is, except for the backup file can only exist folder, this condition constrains its entire directory tree)

Data backup:

/mongodump--host 127.0.0.1:27017-d lanzhoudb-o/data/mongodb/data/--directoryperdb

Where:--host 127.0.0.1:27017 as host port

-D Panodb for the database to be backed up

-o/data/mongodb/data/for backup Files directory (backup file directory Please select the hanging directory, but because of the above constraints, the hanging disk must be an empty disk, which saves the backup file copy time)

Data recovery:

Mongorestore--db Lanzhoudb/data/mongodb/data/lanzhoudb

Where:--db Shanxidb is the name of the database to be restored is LANZHOUDB

/data/mongodb/data/lanzhoudb the folder where the backup file is stored, and the table name is automatically generated after the backup

MongoDB Backup Recovery

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.