Error migrating to Atlas from a private replica set

I’ve already switched from standalone to replica set doing the steps in this wiki:

I’m able to connect to the replica set (tried it with Compass), and see the data but the migration tool is always failing with this message:

Live Migration encountered an error: could not initialize source connection: could not connect to server: server selection error: server selection timeout current topology: Type: ReplicaSetNoPrimary Servers: Addr: localhost:27017, Type: Unknown, State: Connected, Average RTT: 0, Last error: connection(localhost:27017[-9]) connection is closed

I’ve whitelisted all four subnets, I even tried to open it to all IP’s and it still failed

Hi @Gilad_Madar,

If I understand correctly, you’re addressing the node you’re aiming to migrate as “localhost:27017”

Please note that localhost only works from the context of a specific local system. In the case of Live Migration, the Live Migration service needs to be able to reach your MongoDB replica set remotely and cannot use localhost as a hostname. Do you have a full qualified domain name that can be reached from another context? Or even a public IP?


1 Like

Thanks Andrew. using the machine hostname instead of localhost solved it.