Upgrade Mongodb replica set from v3.6 to 5.0

Hi,

We are trying to upgrade the mongodb replica set from v3.6 to v5.0, I’ve tried to upgrade the binaries, by extracting the binaries and replace the existing ones but it is failing to upgrade the server… it’s just upgrading the shell not the server. So what approach can we try further? As we have only 35Gb data for mongodb replica set and around 30 databases

Can anyone suggest on this? as we tried to initialize new server with 5.0 version and tried dumping the older data from the 3.6 version, it worked but it’s a manual intervention, can we bypass this?