Fix Mongosync Atlas to Atlas documentation examples to avoid confusion
Description
The documentation for Atlas to Atlas migration via mongosync has confusing examples (generic for on-prem servers) and a wrong example for SRV connection.
Documentation
cluster0:
mongodb://clusterAdmin:[email protected]:20020,clusterOne02.fancyCorp.com:20020,clusterOne03.fancyCorp.com:20020
cluster1:
mongodb://clusterAdmin:[email protected]:20020,clusterTwo02.fancyCorp.com:20020,clusterTwo03.fancyCorp.com:20020
- Correction proposal:
We should use
cluster1Name.ab123.mongodb.net:27017
and cluster2Name.ab123.mongodb.net:27017
as generic name for an Atlas server name for each case and ensure we replace 27017 as default port instead of 20020 for all the examples on the linked documentation.
Using a generic server and a port different from the Atlas default connection port may cause confusion at the time to connect.
mongosync \
--cluster0 'mongodb+srv://clusterAdmin:[email protected]:20020/' \
--cluster1 'mongodb+srv://clusterAdmin:[email protected]:20020/'
Correction proposal:
This command is incorrect, the SRV connection string doesn't includes the port in Atlas. The correct command should be:
mongosync \
--cluster0 'mongodb+srv://clusterAdmin:[email protected]/'\
--cluster1 'mongodb+srv://clusterAdmin:[email protected]/'
commands
mongosync --config mongosync.conf
curl localhost:27182/api/v1/progress -XGET
curl localhost:27182/api/v1/start -XPOST --data '{"source": "cluster0", "destiantion": "cluster1"}'
Note: run the first command in the background or use another terminal.
Let me know if you need any further clarifications on this.
Form more information: link here
Official Documentation click link