数据库的Mongorestore引起了我的麻烦 [英] Mongorestore of a db causing me trouble

查看:59
本文介绍了数据库的Mongorestore引起了我的麻烦的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是MongoDB的新手,我很难备份本地数据库并将其还原到服务器上.我在Mongo的网站上找到了链接: http://www.mongodb.org/display /DOCS/Import + Export + Tools ,但还原仍然存在问题.

I'm new to MongoDB and I have hard time to backup my local DB and restore it on my server. I found the link on Mongo's website : http://www.mongodb.org/display/DOCS/Import+Export+Tools but I still have problems with the restore.

备份时,我会致电

mongodump --db Gen

然后我看到所有集合都转储到/bin/dump/Gen文件夹中

Then I see that all the collections are dump in /bin/dump/Gen folder

我将本地呼叫复制粘贴到服务器的同一文件夹中

I copy-paste from local to the server in the same folder the call

mongorestore --db Gen --drop --dbpath dump/Gen

但是我得到以下信息: Error : root directory must be a dump of a single database when specifying a db name with --db

But I get the following : Error : root directory must be a dump of a single database when specifying a db name with --db

推荐答案

好的,我发现我做错了什么:

Ok I find out what I'm doing wrong :

我在做

mongorestore --db Gen --drop --dbpath dump/Gen

但是如果没有--dbpath,它就可以正常工作!

But without the --dbpath it works just fine!

mongorestore --db Gen --drop dump/Gen

谢谢大家!

这篇关于数据库的Mongorestore引起了我的麻烦的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆