Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
446 views
in Technique[技术] by (71.8m points)

mongodb - 从本地迁移到MongoDb Atlas(Migrating to MongoDb Atlas from Local)

I'm trying to migrate my local MongoDB over to Atlas.

(我正在尝试将本地MongoDB迁移到Atlas。)

I managed to run the mongodump command with localhost and can see the files in ./dump/data.bson

(我设法用localhost运行mongodump命令,并且可以在./dump/data.bson中看到文件)

However, when I now want to restore this dump onto Atlas, I get "Failed: error connecting to db server: no reachable servers".

(但是,当我现在想将此转储恢复到Atlas时,出现“失败:连接到数据库服务器时出错:没有可访问的服务器”。)

This is odd because I can connect to Atlas from the mongo shell (v4.0) using this command: "mongo mongodb+srv://cluster0-xxxxxx.mongodb.net/test --username Bob" where i get prompted for password and connect fine.

(这很奇怪,因为我可以使用以下命令从mongo shell(v4.0)连接到Atlas:“ mongo mongodb + srv://cluster0-xxxxxx.mongodb.net/test --username Bob”,在此提示输入密码并连接正常。)

This is the mongorestore command that's giving me the above connection error:

(这是mongorestore命令,它给了我上面的连接错误:)

mongorestore --ssl --host mongodb+srv://cluster0-xxxxx.mongodb.net/test --username Bob --authenticationDatabase admin --dir dump/data --password Test123

Appreciate your help.

(感谢你的帮助。)

  ask by Jat90 translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...