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