What is the best practice for making a Magento update (of a badly maintained Magento installation).
I think of things like the following:
- Have a look at full overwrites modules in app/code/local - compare the files with the old version and forward-port them to the new Magento version
- Compare templates
- Compare layout XML files (if they were copied directly to the custom theme folder and no single layout.xml containing only the real updates was used)
- Compare the methods of the rewritten classes to the methods of the original class
The main problem is: When diffing files in old, badly maintained Magento installations, you never know, which version the original file that was copied had. Sometimes I tried to identify the old version by having a look on Magento's copyright in the file comment.
To avoid hassle during update we usually do the following:
- Avoid rewrites, use events instead
- If rewrites are necessary, try to not copy code but call parent::method() to keep only the necessary functionality in the overwritten class
- If copying code is necessary, use a marker-comment such as
[Mycompany BEGIN] ... [Mycompany END] - Do not copy entire layout files but use a single layout.xml that does only updates.
But how to do an update if those precautions where not taken?