Lightroom 3 Book for Digital Photographers by Scott Kelby »

How to Perform an Upgrade in Zencart

We are assuming that we are doing a "major version" upgrade to ZenCart. Here we will use the example of going from version 1.3.7 to 1.3.8. The safe approach is to perform an upgrade on a "clone" of the shop and then migrated the upgraded files back to the live shop. One checklist you might want to consider is the following...

1) Backup PHP files and MySQL database of the live shop (the 1.3.7 one). Keep a set of this PHP files on your local disk (hereafter known as "working fileset"). Also write down any important admin setting such as payment modules, shipping modules, etc.

2) Use those backups to produce a clone of shop on a development server. This also confirms that you got good backups that can restore the original shop.

3) Next, we need to determine which files of your live shop have been customized or modified. (Do not rely on a list, because that list is often inaccurate due to the fact that developers might have changed a file without updating the list). Do a full file-by-file comparison by downloading an archive copy of Zencart version 1.3.7 (hereafter known as "1.3.7 reference fileset"). Use WinMerge to determine any differences between the 1.3.7 reference fileset and your working fileset. WinMerge can file-compare whole directories at a time and will show you the "diff" of each file difference. These differences between the two sets will be known as the "list of files to be merged".

4) Download the latest version of ZenCart (the version that you are upgrading to) - hereafter known as " 1.3.8 reference fileset". Except for the "list of files to be merged" and the includes/configure.php and admin/includes/configure.php files, copy these 1.3.8 files to the working fileset. Whenever you make additions or edits to the "working fileset", keep track of the list of files. Because those are exactly the files that will need to be deployed to the production site in the end.

5) Using WinMerge, "code merge" the customizations of the "list of files to be merged" to the working fileset. Code merge means to determine the new snippets of code that is in reference 1.3.8 fileset that is different from the 1.3.7 reference fileset of ZenCart. Merge those code difference to the working fileset. Again, keep track of a list of these files and any changes you are making to the working fileset. Note when doing merges, take into account the template override system. This comes into play if the base files have changed, then you might also need to change the customized file in the customized template folder.
Note: Performing code merges is not easy -- especially if you have to reconcile three different versions of a file. If you are not a programmer, we recommend that you hire a professional.

6) Upload the working fileset to the clone on the development server, making sure never to overwrite the includes/configure.php and admin/includes/configure.php files.

7) Make sure you upload the zc_install folder of 1.3.8 reference file set. Perform any database upgrade as instructed in the 1.3.8 upgrade instructions. Follow any upgrade instructions. You can also review the "changed", "deleted", and "added" files in the "docs/changelog* files. Remove the zc_install folder when done.

8) If payment and shipping modules have changed in the new version, you will have to uninstall and re-install the modules. But make sure you write down all your setting first.

9) Test clone

10) Migrate the files from the working fileset that have changed to the live shop, making sure never to overwrite the includes/configure.php and admin/includes/configure.php files.

11) Test with a real purchase of the live upgraded production site.