Magento 1 Update - How to

Rico Neitzel told me back in the days, that during Magento updates files gets deleted, therefore it is a bad idea, therefore you want to run a patch (not the ones from Magento, but a patch between the versions) over your Magento installation.

After fiddeling around for a while it is a good idea to document, what I have just done (I updated from 1.9.2.2 to 1.9.3.3):

  1. Get a trusted git repository with all Magento versions you need, I can recommend https://github.com/OpenMage/magento-mirror
  2. Clone it

    git clone https://github.com/OpenMage/magento-mirror.git
    
  3. Make sure your current installation is free of core hacks and all files exists which might get patched

    magento-mirror$ git checkout 1.9.2.2 (old version)
    production$  rsync --progress -v -r ../magento-mirror/* .
    
  4. You might have now too much files - either you have them already in your gitignore - if not, time to add them.

  5. Create a patch file (diff-index is needed for binary patches)

    magento-mirror$ git checkout 1.9.3.3 (new version)
    magento-mirror$ git diff-index 1.9.2.2 --binary > patch.patch
    
  6. Apply the patch

    production$ git apply --binary ../magento-mirror/patch.patch
    
  7. Now you have a working copy with all the changes. You can review them, commit them, etc.

Review Magento Updates

This blogpost is of the kind: I don't want to forget that this exists, therefore I hope it helps you, but it's mine. :o)

Magento updates are pain, because of the damn fcking cockspl*t @copyright header.

Thanks to Franklin P Strube there is a solution for this:

  • Copy your new magento version over the old one.
  • Run the command:

    git diff -G '@copyright.*[Cc]opyright' --name-only | xargs -I {} sh -c 'FILE={} ; [ $(git diff -U0 -- $FILE | wc -l | tr -d " " | cut -f1-) -eq 7 ] && git add $FILE'
    

Then most of the files which contain the copyright header are staged. Unforunately when I'm reading the command correctly, the whole file is staged, not only the line. Maybe only the files are added where ONLY the copyright header is changed. Please try.

There is a second answer from Luke H which might help too. I don't understand a word of these commands, so no description.