You’ll need to upgrade by version. Backup, then move to latest 20.x and repeat until you end up at a more recent release. Good luck!
PHP 7.3 or 7.4 are fine for moving to 22 according to these docs. You can also add the 21 speed tweak via nginx as described in that release’s documentation.