I have multiple Magento websites with different versions (1.9.0.1, 1.9.1.0 and 1.9.1.1) in multiple servers. Is there any more easy and painless way other than ssh into each server separately and apply the patch files?
-
Hi Pedram, You can't do it from single file execution because your websites are located on different server. I think installing a security patch using SSH is the best and painless way as compare to any other processes.– Praful RajputCommented Aug 18, 2015 at 5:54
-
Thanks, but I think there should be a better way, cause everyone wants to be DRY not WET :)– Pedram BehrooziCommented Aug 18, 2015 at 6:07
-
If you are using VCS (version control system). Then you can create a updated files zip with directory path using command git ls-files --modified | xargs -i cp {} ~/tmp and you can overwrite this folder to your website.– Praful RajputCommented Aug 18, 2015 at 7:03
-
1I think the pain caused by a failed automatic update process across multiple live shops would vastly outweigh the 5 minute pain of applying a patch manually.– pajCommented Aug 18, 2015 at 7:18
2 Answers
Depends on your deployment process but you will have to apply each patch at least once per Magento version because the patch files are different from version to version.
A possible approach is to install Magento with composer from a single "Magento Core" Git repository. This repository should have one branch per version (1.9.0.1, 1.9.1.0, 1.9.1.1 and so on), so that you can apply patches for each Magento version.
Example branch structure:
* 59eba08 init Magento 1.9.2.0 (tag: 1.9.2.0, origin/ce-1.9.2.0, ce-1.9.2.0)
| * d4c0a85 (tag: 1.9.1.0-patch6285, origin/ce-1.9.1.0, ce-1.9.1.0) PATCH_SUPEE-6285
| * 5bedc45 PATCH_SUPEE-5994 (tag: 1.9.1.0-patch5994)
| * 8147f19 PATCH_SUPEE-5344 (tag: 1.9.1.0-patch5344)
| * 2c73257 PATCH_SUPEE-4829 (tag: 1.9.1.0-patch4829)
| * e8916e5 Init Magento CE 1.9.1.0 (tag: 1.9.1.0)
|/
* ba94c8b (origin/master, master) Initial commit (only composer.json)
Then apply the patch on the branch of each Magento version that you are actively using and run composer update magento/ce
(or similar) on each installation.
The tagging format x.x.x.x-patchXXXX
is important, so that composer understands the versions (See: https://getcomposer.org/doc/02-libraries.md#specifying-the-version). require: { "magento/ce":"1.9.1.0"}
will install the 1.9.1.0
tag with the highest -patch
suffix.
-
1Great. I'm using Composer and I was trying to figure out a way to apply patches using this approach. I'll definitely try your advise. Commented Aug 18, 2015 at 9:07
-
3Recently I wrote blog post on the same topic - razbakov.com/blog/install-magento-via-composer Commented Aug 19, 2015 at 5:52
-
Thanks for adding the link to your post. Alekeyi +1 informative! Commented Aug 24, 2015 at 22:03
-
Fabian, thanks for that link - I had hit a wall with my understanding of how Composer handled the resolution of versioning with patches in a standard way. Semantic Versioning #FTW Commented Aug 24, 2015 at 22:05
No - according to my knowledge you'll need to execute the patches manually. Better test the patches and make sure your website's functionality remains intact...