There is no documentation - largely because the files involved will be different for everybody.

There is however, a PROCEDURE.

Your new template (you call it THEME - a "wordpress" term) should all be based on the latest version of ZC, so before you change "themes", you should do a full upgrade anyway.

If you have any module installed that you want to keep, then you are going to have to establish if that module (when originally installed) over-wrote any CORE files. Some modules do overwrite a few core files - and if they do, then you are either going to have to find out if that module is compatible with the latest version, or what needs to be done to the code in the over-written files.

You will need to COMPARE the files of that module, to their equivalent CORE FILES in 1.3.9h .

Then, you will need to MODIFY the module file so that it meets any new core-code formats evident in the core 1.3.9 file.

THEN... you need to do the same with OVER-RIDE files... (Note: above I talk of OVERWRITTEN core files... now we deal with files that OVER-RIDE the core files.)

When your MODULES and ADD-ONS have appropriate code changes applied, that bring them into line with 1.3.9h protocols, you can do a full upgrade of the site.

Then, you can start working on your new template (theme) knowing that your PHP code is up-to-date, and your database is also patched to the new version.