Hi @Akhila ,
yes you need to upgrade from your version to the latest lts and then to you desired version (as stated here) . As you noted correctly sonarqube does not support mysql anymore, but there is a foss tool that helps you to migrate from mysql to postgresql. you can find more details in this post here.
As for the scanners you should stick to a newer version as we continuously improve upon them as well
In general you should create a test environment to test every step before upgrading your productive instance, to make sure that there is nothing unexpected happening in the process. It is also good practice to have a backup of the database that you could restore from before doing the migration/upgrade but apart from these safety measures you just have to follow the upgrade documentation and should be good to go
hope that helps and happy upgrading