时间:2021-07-01 10:21:17 帮助过:7人阅读
1,数据导出
[root@localhost ~]# mongodump -h 192.168.60.237 -o /root/test 2015-05-27T13:34:45.737+0800 writing test.fs.chunks to /root/test/test/fs.chunks.bson 2015-05-27T13:34:45.737+0800 writing test.fs.files to /root/test/test/fs.files.bson 2015-05-27T13:34:45.737+0800 writing admin.system.indexes to /root/test/admin/system.indexes.bson 2015-05-27T13:34:45.737+0800 writing test.system.indexes to /root/test/test/system.indexes.bson 2015-05-27T13:34:45.738+0800 writing admin.system.users to /root/test/admin/system.users.bson 2015-05-27T13:34:45.738+0800 writing admin.system.version to /root/test/admin/system.version.bson 2015-05-27T13:34:45.739+0800 writing admin.system.users metadata to /root/test/admin/system.users.metadata.json 2015-05-27T13:34:45.739+0800 writing test.fs.files metadata to /root/test/test/fs.files.metadata.json 2015-05-27T13:34:45.741+0800 writing admin.system.version metadata to /root/test/admin/system.version.metadata.json 2015-05-27T13:34:45.743+0800 done dumping test.fs.files 2015-05-27T13:34:45.743+0800 done dumping admin.system.users 2015-05-27T13:34:45.743+0800 writing test.blog to /root/test/test/blog.bson 2015-05-27T13:34:45.744+0800 done dumping admin.system.version 2015-05-27T13:34:45.744+0800 writing test.blog metadata to /root/test/test/blog.metadata.json 2015-05-27T13:34:45.746+0800 done dumping test.blog 2015-05-27T13:34:45.761+0800 writing test.fs.chunks metadata to /root/test/test/fs.chunks.metadata.json 2015-05-27T13:34:45.762+0800 done dumping test.fs.chunks [root@localhost ~]#
C:\Program Files\MongoDB 2.6 Standard\bin>mongorestore.exe -d test --directoryp erdb E:\mogo_data2\test --drop 2015-05-27T13:58:17.265+0800 Hotfix KB2731284 or later update is not installed, will zero-out data files connected to: 127.0.0.1 2015-05-27T13:58:17.268+0800 E:\mogo_data2\test\blog.bson 2015-05-27T13:58:17.268+0800 going into namespace [test.blog] 2015-05-27T13:58:17.268+0800 dropping 2015-05-27T13:58:17.271+0800 Created collection test.blog with options: { "cr eate" : "blog" } 1 objects found 2015-05-27T13:58:17.272+0800 Creating index: { key: { _id: 1 }, name: "_id_", ns: "test.blog" } 2015-05-27T13:58:17.275+0800 E:\mogo_data2\test\fs.chunks.bson 2015-05-27T13:58:17.275+0800 going into namespace [test.fs.chunks] 2015-05-27T13:58:17.276+0800 dropping 2015-05-27T13:58:17.280+0800 Created collection test.fs.chunks with options: { "create" : "fs.chunks" } 271 objects found 2015-05-27T13:58:17.471+0800 Creating index: { key: { _id: 1 }, name: "_id_", ns: "test.fs.chunks" } 2015-05-27T13:58:17.472+0800 Creating index: { unique: true, key: { files_id: 1, n: 1 }, name: "files_id_1_n_1", ns: "test.fs.chunks" } 2015-05-27T13:58:17.474+0800 E:\mogo_data2\test\fs.files.bson 2015-05-27T13:58:17.475+0800 going into namespace [test.fs.files] 2015-05-27T13:58:17.475+0800 dropping 2015-05-27T13:58:17.480+0800 Created collection test.fs.files with options: { "create" : "fs.files" } 266 objects found 2015-05-27T13:58:17.482+0800 Creating index: { key: { _id: 1 }, name: "_id_", ns: "test.fs.files" } 2015-05-27T13:58:17.484+0800 Creating index: { key: { filename: 1, uploadDate : 1 }, name: "filename_1_uploadDate_1", ns: "test.fs.files" } 2015-05-27T13:58:17.487+0800 Creating index: { key: { filename: 1 }, name: "_ filename", ns: "test.fs.files" } C:\Program Files\MongoDB 2.6 Standard\bin>
略
mogodb备份机制
标签: