我正在尝试将mongo从本地迁移到atlas。我做了mongodump,它正确地创建了.z存档。
但是,当我尝试恢复时,如下所示:
mongorestore --uri="mongodb+srv://<user>:<password>@xxxxx.ipmg6.mongodb.net/myDbName" --archive=mongodump_2021-05-22_09-05-44.gz --gzip我看到了输出
2021-05-23T07:25:01.340+0200 The --db and --collection flags are deprecated for this use-case; please use --nsInclude instead, i.e. with --nsInclude=${DATABASE}.${COLLECTION}
2021-05-23T07:25:01.350+0200 preparing collections to restore from
2021-05-23T07:25:01.360+0200 0 document(s) restored successfully. 0 document(s) failed to restore.没有错误,但也没有处理任何文档。你知道哪里出问题了吗?我想没有来自mongo的错误或警告吗?
发布于 2021-05-23 14:41:15
好的解决方案是--nsInclude丢失了。如果要恢复整个数据库,则应使用--nsInclude="*"。
发布于 2021-07-22 06:35:31
这对我很有效:
mongorestore --drop /dump --nsInclude="*""/dump“位是mongodump目录的路径。
https://stackoverflow.com/questions/67656468
复制相似问题