I am trying to migrate my data to a self-hosted mongodb, but I cannot connect to the current database hosted by Moralis using the MongoDB IP provided in the admin interface.
I have tried via nodejs code created for the moralis self hosting video: https://github.com/IAmJaysWay/mongoDBmigartion
AND I also tried with MongoDB compass.
The errors are similar
MongoDB compass error
connection <monitor> to 159.223.161.245:56728 closed
NodeJS code error
MongoServerSelectionError: connection <monitor> to 159.223.161.245:56728 closed
at Timeout._onTimeout (S:\Dropbox\QuarkStars\mongodb-migration\mongoDBmigartion\node_modules\mongodb\lib\sdam\topology.js:293:38)
at listOnTimeout (internal/timers.js:557:17)
at processTimers (internal/timers.js:500:7) {
reason: TopologyDescription {
type: 'Unknown',
servers: Map(1) { '159.223.161.245:56728' => [ServerDescription] },
stale: false,
compatible: true,
heartbeatFrequencyMS: 10000,
localThresholdMS: 15,
setName: null,
maxElectionId: null,
maxSetVersion: null,
commonWireVersion: 0,
logicalSessionTimeoutMinutes: null
},
code: undefined,
[Symbol(errorLabels)]: Set(0) {}
I have tried:
- Whitelisted all my ipv4 address including DNS addresses on the admin interface and pressed save config
- Switching to useUnifiedTopology:false
The error is the same.