In case you don't read any further... make sure you take full backups of Moodle before you touch anything.
I would strongly recommend migrating to a new server. Release-upgrade will almost certainly work in that it'll upgrade Ubuntu. The most likely outcome, however, is that it will trash your database. Not the end of the world (if you have a backup) but a hassle.
I just like the idea of knowing that I have a completely clean server and then re-installing my Moodle data. If we're talking Ubuntu Server then always go with the LTS. I think that's currently 22.04
I would strongly recommend migrating to a new server. Release-upgrade will almost certainly work in that it'll upgrade Ubuntu. The most likely outcome, however, is that it will trash your database. Not the end of the world (if you have a backup) but a hassle.
I just like the idea of knowing that I have a completely clean server and then re-installing my Moodle data. If we're talking Ubuntu Server then always go with the LTS. I think that's currently 22.04
BUT... you also need to consider what Visvanath is saying above ^^