This isn't a Moodle question, as such. It depends on a lot of things - mostly what your VPS distro is.
I would say one thing - make very sure you have a good database backup before you try to do anything. I have had very poor experiences attempting to upgrade MySQL / MariaDB. Personally, I would consider upgrading the whole VPS to a suitably newer version.
I would say one thing - make very sure you have a good database backup before you try to do anything. I have had very poor experiences attempting to upgrade MySQL / MariaDB. Personally, I would consider upgrading the whole VPS to a suitably newer version.