by Howard Miller.
You *should* be able to upgrade through the various versions...
https://help.ubuntu.com/community/OneiricUpgrades
https://help.ubuntu.com/community/PreciseUpgrades
...you can stop at 12.04 as it is a long term support release. Or...
https://help.ubuntu.com/community/QuantalUpgrades
If it was me, however, I'd copy my Moodle backups (which you do have, yes?) and then do a clean install of the latest version.