@Ramachandra_Tummala
Yes I’m certainly sure that I restored to port 27018 and I followed the second answer from this post How do I copy a database from one MongoDB server to another? - Stack Overflow.
If I understood it correctly I have ran the ssh tunnel on new server which makes all the request forwarded through port 27018 to old server (the db from which Im going to dump) with default port.
when I do mongo on new server this is what I get -
mongo
MongoDB shell version v4.4.17
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Error: couldn’t connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :
connect@src/mongo/shell/mongo.js:374:17
@(connect):2:6
exception: connect failed
exiting with code 1
However when I do mongo --port 27018 on the same new server this is what I get-
mongo --port 27018
MongoDB shell version v4.4.17
connecting to: mongodb://127.0.0.1:27018/?compressors=disabled&gssapiServiceName=mongodb