Errors fixing procedures during upgrade
Errors shouldn't happen during upgrade, but it maybe that site is heavily modified and then some problems can occur.
For experienced users only !
If script fail during system upgrade (you get error before "System after update custom script was successfully executed") then you can fix the problem and can try to run upgrade script again.
If upgrade fail during modules upgrade (you get error after "The following modules will be updated:" ) then the best solution is to restore site from backup, fix the problem and run upgrade script again.
Even if your site is working fine after modules upgrade fails - I suggest you to complete upgrade someway - in other case you can have unpredictable results and future problems with upgrade.
It is better to make always backup right before upgrade procedure. But if you have no backup or it is too old - it is a problem! and you will need custom upgrade - you can try to do it by yourself - but it is dangerous way, I suggest to hire someone to do it for you.
If you still want to do it by yourself - I do not guarantee at all if everything will work, but if you want to try anyway - here are the instructions:
Lets assume that you are upgrading from 7.0.9 to 7.1.0, but this procedure is the same for other versions, just replace 7.0.9 and 7.1.0 with the versions you are upgrading from and to.
0) Make backup of current system, if you miss the backup before, make it at this stage at least, so you will not make the things even worse.
1) Fix the error you get during modules upgrade.
2) Then you need to check which modules are already upgraded - you can check it by comparing current module version in sys_modules table:
1.0.9 - module is not upgraded yes
1.1.0 - module is already upgraded
3) Delete already upgraded modules from /upgrade/files/7.0.9-7.1.0/modules/ folder.
4) Delete (or comment out) "alter tables" statements from /upgrade/files/7.0.9-7.1.0/sql.sql file - they can not be applied twice.
Usually these statements are in the beginning of the file.
5) Set "sys_tmp_version" config variable in "sys_options" table back to 7.0.9
6) Run upgrade script again following all the instructions.
7) If it fails again - fix the error and repeat all the steps.