Migration from to new server and update version sequence

We currently using Matomo on-premise, version 3.14.1. We would like to migrate to a new server. Is it obligated to migrate into the same server version if we can migrate to a new version, Matomo 4.12.3?