csb1983 Posted December 9, 2011 Share Posted December 9, 2011 Hello, I have spent many hours modifying the core files of Prestashop to better suit my needs, and it is a little frustrating that there is no option to download the changed files, instead the only option is to download the complete package or run the auto update tool, which will overwrite all my work. I think it would be beneficial to all users to supply a small pack of the changed files only, so we can upgrade our prestashop without having to apply our changes all over again. If there needs to be database changes a small SQL file that we can execute could also be included. Most open source offer these upgrade only files (Joomla etc) and I hope the Prestashop developers can understand where I coming from. I would also like to say that I really do appriciate the amout of effort that is put into Prestashop it is by far the best opensource shopping cart solution :-) Many thanks Chris Link to comment Share on other sites More sharing options...
Dave L Posted December 10, 2011 Share Posted December 10, 2011 I'm probably not in the best position to give a definitive response as I'm not experienced at extensively modifying prestashop. However, as you have not yet had a response to your post I'll give you my take. Most changes that are made to prestashop are done within the theme. Given the correct process to follow before making changes to the theme is to duplicate and rename the original theme and then make any changes to the duplicated theme. Following any upgrade none of the changes made to the duplicated theme are left intact. Most modifications to core files are the ones made to .tpl files of modules. In this case a module override folder can be made/used as part of the theme. Again, none of these changes would be lost during an upgrade. There is also an /overrides folder for other core files. I'm not sure if these files are affected during an upgrade but these can be easily handled by a back-up prior to upgrade. Changes to text/labels for just about everything that appears in the FO can be done using the Front Office Translations feature. These can be exported prior to upgrade and then imported again afterwards so nothing would be lost there. That would just leave a small number of core files, if any at all, which have not already been dealt with that could simply be backed up prior to upgrading. So really, there would be no need to provide changed files and sql database files separately. Link to comment Share on other sites More sharing options...
csb1983 Posted December 11, 2011 Author Share Posted December 11, 2011 Dave, thanks for your reply, however what you are saying does not make sense. If I backed up my files, upgraded and then re-instate the original (backed up) files, I would just be backed to where I started with a non upgraded Prestashop. The important upgrades that are done to the core files are usually security patches. If there was a changed files package I could open these files re-apply my changes and then copy them into my sites files, then it would take no time at all to do. I also use my own theme so the template changes make no differance to me anyway. The fact that you say there is a small number of core files that are changed is exactly the point I was originally trying to make. Why do we need to overwrite the whole install when only a few files need to be changed... Link to comment Share on other sites More sharing options...
Dave L Posted December 11, 2011 Share Posted December 11, 2011 Dave, thanks for your reply, however what you are saying does not make sense. If I backed up my files, upgraded and then re-instate the original (backed up) files, I would just be backed to where I started with a non upgraded Prestashop. Sorry for not making myself clearer. I'm not suggesting that you just re-instate the backed up files. Of course you wouldn't gain anything by doing this. However, using the backed up files that you made changes to enables you to merge your modifications into the new files. The fact that you say there is a small number of core files that are changed is exactly the point I was originally trying to make. Why do we need to overwrite the whole install when only a few files need to be changed... If you look at the change logs for the new releases there are often hundreds of changes made, not just for security updates but also many bug fixes. Overwriting the whole install would be the only way, in most cases, to ensure all these fixes were carried over. Having said that prestashop is currently evolving further with the new auto-upgrade feature (although currently still experimental). Part of the process is the list of all the core files that have been changed being provided before the upgrade continues. This provides the opportunity to see which core files will be overwritten with the upgrade. With this you would know precisely which, if any, of the core files to carry your modifications over to. As I said I'm not in the best position to give a definitive response but I do feel sure that making arbitrary modifications to core files without using the methods designed for such, is not making best use of the software. I'm not saying for a minute that this is true in your case but I see so many times on this forum where a user is asking which core file they need to modify to make a particular change when there is a way to affect the same change via the BO. Link to comment Share on other sites More sharing options...
Rhapsody Posted December 11, 2011 Share Posted December 11, 2011 In the beginning I too was frustrated by the lack of information with a simple list of what files have changed when updates are made. Over time by reading this forum I've learned tips on how to do upgrades with minimal impact. You should read this post on the blog titled Modules, Classes and Controller Override by Julien Breux Some of my own experiences.... 1. Templates - make your own custom template modifications. I made mine starting with the default Prestashop theme starting with a 1.3 version when first using Prestashop. I have incrementally upgraded as Prestashop has been upgraded to 1.4.6.2. I have done extensive changes to get the look desired with the CSS files in the theme, and with custom images. 2. Module updates - many of the modules can be formatted with .tpl file updates. These files would be stored in your custom theme directory under modules subdirectory. They will override anything that is updated. I have 6 modules overridden using this method. 3. Core file overrides - Starting with version 1.4, I started transitioning the core file updates I made into overrides for the controllers and class files. This allows Prestashop upgrades to be made without having to modify the core files for each upgrade. I have 4 class files overridden and 2 controller files overridden. 4. Language Files - Make sure you use the translation tab to backup any language translations or redefination of field names. These can be easily uploaded again to restore your text customizations if they ever get changed by an upgrade. Stuff that gets overwritten on an upgrade. 4. Mail files - I have modified all the mail templates for the languages used. I'm not sure if autoupgrade overwrites these, but I keep them in a directory on my hard disk that I can upload to the server if I ever need to replace files that are overwritten. 5. Image files - I backed up my image directory in case they ever get overwritten. I have had a problem with this in the past. 6. Admin files - There is no sure method on this that I know of if you modify the core that stops these from being overwritten. I have modified 3 core files in the tabs directory to reformat data and display what I want. I keep backups of these that can be uploaded after an upgrade. Tool to help with checking updates: I found a free, open source tool called WinMerge that allows easy comparison and update of two files. What I found useful is to put the latest release and previous release prestashop directories in a temp directory, then compare the two. I then drill down to find any files I've modified to see if the files have been modified between the two releases. Using this method, I can easily determine if the updates to any of the files I've changed are needed. What used to take me a couple of hours to do an upgrade with all mods is now performed in less than 15 minutes. Check out a previous post I made - Helpful Hints for Automatic Upgrade (plus some manual edits) Link to comment Share on other sites More sharing options...
csb1983 Posted December 11, 2011 Author Share Posted December 11, 2011 Rhapsody, Some great pointers in your post and excellent resources too, which is appriciated. I was looking though this forum at a few random topics, and I still wonder how many of the posts on here simply would not exist if small upgrade packages were available. Link to comment Share on other sites More sharing options...
M.N Posted April 1, 2021 Share Posted April 1, 2021 (edited) Nine years old topic and still the same problem, one click upgrade overwrites all files. Solution is to make your own update, where only changed files are. In principle it is simple, but a lot of steps. Major idea is just take One click upgrade, VERSION COMPARISON, See or hide the list - see the list of all changed files, select and copy list to any text redactor (UPDATE: Just discovered the list was not complete. There were more files changed, than listed in this One click upgrade module! So, be careful.). Make every line as command to copy with making folder also, Linux command cp --parents and your folder name. In sample I made same level folders all and select, so command sample is with three lines as: cp --parents all/admin/themes/default/package-lock.json select; cp --parents all/admin/themes/new-theme/js/pages/order/create/product-renderer.js select; cp --parents all/admin/themes/new-theme/js/pages/order/create/create-order-map.js select; In text redactor it is quick search and replace process. With new Prestashop files extracted to all folder you can now run these commands in SSH window, about 30 at a time for checking the errors. When all done run also command find select -type f | wc -l results count of files in the folder structure. Compare the count to your list or number in One click upgrade and if the same number, then it is done. You have replicate folder structure of prestashop with only changed files. Sure there should be easier way also, but I am not programmer... Edited April 9, 2021 by M.N (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now