4. MongoDB Learning Backup and restore

Source: Internet
Author: User
Tags mongodump mongorestore

One, MongoDB Backup 1, mongodb backup backup data using the following command mongodump-h dbhost-d Dbname-o dbdirectory back up the user database [[email protected] bin]#. mongodump-h127.0.0.1-d User-o/home/

[[email protected] bin]# Ls/home/user/b3.bson B3.metadata.json C1.bson c1.metadata.json# can see the backed up files 2, MongoDB single collection backup backup T The C1 collection under the EST library [[email protected] bin]#./mongodump-h127.0.0.1-d test-c c1-o/tmp/

Second, MongoDB restore 1; single-Library restore [[email protected] bin]#./mongorestore-h 127.0.0.1:27017-d user/home/user/#客户端查看到整个user数据库已经还原成功了

2. Single set restore [[email protected] bin]#./mongorestore-h 127.0.0.1:27017-d test/tmp/test/#单集合还原也是不需要制定具体集合名称

Summary: MongoDB above backup restore is only for full-scale backup, incremental backup also need to study

4. MongoDB Learning Backup and restore

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.