...
Besides these caveats we've not encountered any major problems with upgrades in our lab tests (tested on CentOS/RedHat 6, Debian 7, Ubuntu 14).
Step by step procedures for upgrading MongoDB from 3.4 to 4.2 are available here
Configuring MongoDB Authentication/Authorization with the setup_mongodb.pl Script
...