Those are trade secrets many partners and long time Kentico devs don't want to just give out! ;)
But my suggestion would be to get your code upgraded and tested out. Take a copy of your production database, then run the scripts directly against the copy of the production database and look for errors during the upgrade. If all is well, you should be able to connect your upgraded code to the prod db and run the scripts. You may want to halt updates for a bit and maybe do it on a copy then switch over to that copy after the upgrade is successful.
There are several ways but it depends on your environment and experience.