我试图将mongodump恢复到不同名称的数据库(这应该可以通过--db <dbname>开关)。
我的工作目录包含一个包含单个数据库转储的转储文件夹。
但是,当我尝试这个命令时:
mongorestore --port xxxxx --db some_destination_db我收到以下错误:
ERROR: ERROR: root directory must be a dump of a single database ERROR: when specifying a db name with --db我不知道为什么我得到这个,并且在google上找不到任何帮助。 有人有主意吗?
I'm trying to restore a mongodump to a differently named database (which should be possible via --db <dbname> switch).
My working directory contains a single dump folder, which contains a single db dump.
However, when I try this command:
mongorestore --port xxxxx --db some_destination_dbI get the following error:
ERROR: ERROR: root directory must be a dump of a single database ERROR: when specifying a db name with --dbI have no idea why I'm getting this, and can't find any help on google. Anyone have any ideas?
最满意答案
您需要包含源数据库转储目录的路径以恢复(如在MongoDB 2.6中)。
例如,如果从“twitter”恢复到“some_destination_db”,您的命令行将类似于:
mongorestore --port xxxxx --db some_destination_db dump / twitter
You need to include the path of the source db dump directory to restore from (as at MongoDB 2.6).
For example, if restoring from "twitter" to "some_destination_db" your command line would be similar to:
mongorestore --port xxxxx --db some_destination_db dump/twitter
更多推荐
发布评论