I don't know exactly, but you can find clues in the
https://openacs.org/xowiki/openacs-compatibility-matrixPg 7.2 works to Openacs 4.6.3
Pg 7.4 works with Openacs 5.2
Pg 8.2 works with Openacs 5.3 to 5.5
It seems to be that you will want to look at the sql upgrade scripts in the core to find the changes needed to work with the db version shifts.
Depending on your code, it might be easier to upgrade the site to use Openacs 5.3 (using a test server) and re-introduce your custom code to it. This way, the site is fully upgraded to 5.3, and the custom code has migrated with it. Also, hopefully you will be able to extract the custom code into areas of the system that are fairly resilient to system changes during upgrades.