You can’t skip major version in MongoDB. The upgrade path would be. 4.0.25 → 4.2.x → 4.4.x → 5.0.x → 6.0.x