Upgrade Mongodb replica set from v3.6 to 5.0

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?