我已经找到了很多关于如何使用mongodump和mongorestore的良好指示,备份我的流星生产服务器并在需要时恢复备份:
meteor mongo --url myApp.meteor.com
mongodump -u client -h production-db-b2.meteor.io:27017 -d myApp_meteor_com -out dump/2014_10_21 -p [password from meteor mongo --url]
mongorestore -u client -h production-db-b2.meteor.io:27017 -d myApp_meteor_com dump/2014_10_21_v2/myApp_meteor_com -p [password from meteor mongo --url]
Run Code Online (Sandbox Code Playgroud)
我没有找到的解释是如何将备份转储恢复到我的本地流星应用程序.我的app文件夹中有一个mongodump输出.我不确定我是否可以使用mongorestore,或者我是否应该做其他事情.
我试过像这样的mongo导入
mongoimport -d test -c foo importfile.jsonmongoimport --host localhost --db local --collection lecturer --type json --file temp.json --headerline --upsert我有相同的错误消息"语法错误:缺少;在语句(shell)之前:1"我的代码有什么问题以及如果我的数据存储在C:\ Documents and Settings\User\Desktop中如何导入?请提前帮助,谢谢
我有一些从我的 centos7 服务器导出的 mongoDB 转储文件(带有 .bson 和 .json 格式)。无论如何要在我的 MongoDB 上在 win10 上导入它们?我正在使用 mongorestore 命令,但是当我设置一个带有“mongorestore”名称和“.../mongorestore.exe”值的环境变量并且 mongod.exe 正在运行时找不到它。
mongodb ×3
bson ×1
dump ×1
import ×1
json ×1
meteor ×1
mongodump ×1
mongorestore ×1
windows-10 ×1