Upgrade Magento 1.x
6/19/2016 2:05:00 PM
Upgrade Magento 1.x, BSSCommerce, BSSConfluence, BSSGroup, Magento 1, Magento 2, Confluence, Magento
Upgrade Magento 1.x
As we all know, Magento is a platform having many modules join together to build up its full and necessary functions for an e-commerce website. These modules are capable of expanding their options to become more compatible with users’ preference. Besides, Magento always keeps to upgrading to newer versions (just like other softwares) to improve its compatibility, too. From there, for every user, rises the question that whether it be essential to keep his Magento version up-to-date.
Because upgraded versions are supposed to have improvement from the former ones, the explaination for why the answer is “Yes” might be (but not limited to) the following reasons: updated security features for websites, fixed functional errors from the old versions, improved performance, newest PHP supported. So, how to upgade Magento? Which steps are needed for upgrading to the newest version with least errors?
We also published: Upgrade Steps (from Magento 1.7 to Magento 1.9.3)
Three ways to upgrade Magento
- Via Magento Connect. This way is rarely used due to the fact that further customization and extension setup are vital factors to get a website officially operate
- Via SSH – using commands. This way requires from developers a capability of fully mastering his own commands
- Manual upgrade. This is the common way currently because ít’s the choice of almost every developer
Base on the popular usage of the third way, here we are going into more details about upgrading Magento manually.
Upgrade Magento manually
Preparation before manual upgrade
In case of upgrading Magento by customers’ orders, there are compulsory requirements.
Firstly, all selling activities on customer’s Magento based website must be stopped during upgrade time to ensure the consistency of all data afterwards. Avoid comtemporaneous performances of those two actions or the database will be changed.
Secondly, zip code folder and export latest database from customer’s site and download them to carry out setup things at local before moveing it all back onto the site. Of course, we can also upgrade directly onto the site but it’s not optimal because it takes plenty of time for code transferring and bug fixing.
Change the website to maintenance mode to make sure it won’t run during upgrade process.
Finally, on localhost where the upgrade proceeds, memory_limit needs to be increased at least 512mb and max_execution_time to be raised to 180000 (file php.ini).
Steps to proceed upgrading Magento at localhost
(Assume now we need to upgrade a site of Magento version 188.8.131.52)
First thing to do is to define current Magento version of the website from which we can decide a proper upgrade solution. It’s important to be aware of the fact that the release of each version of Magento is accompanied with lots of changes in coding, database, structure of files and folders. That’s why the closer version that website is upgraded to, the less posibilities of errors happenning there are. With our assumption that the site is using Magento 184.108.40.206, there are other versions borned after that: 220.127.116.11 – … -18.104.22.168 – 22.214.171.124 – 126.96.36.199 – … -188.8.131.52 – 184.108.40.206 – … – 220.127.116.11 – 18.104.22.168 – 22.214.171.124 – 126.96.36.199 – … – 188.8.131.52. Instead of upgrading from 184.108.40.206 to 220.127.116.11 at once, do it gradually by shorter jumps over versions will minimize the number of errors relating to database and also controlling them will be much easier. If not, at least it should follow this upgrade rule: 18.104.22.168 → 1.7.x → 1.9.x.
- For Magento versions from 22.214.171.124 back to older ones, we need to upgrade it to version 1.7.x before getting to version 1.9.x.
- For Magento versions from 1.5.x to more recently, it might be upgraded directly to 1.9.x. More details in the photo below
Therefore, back to assumption, at least two versions of Magento needs to be downloaded to upgrade our site.
Create database at phpmyadmin, then import the database downloaded from the site at Step 1. Setup database with code we just made a backup from customer’s to see whether any error occurs when running on local. (Remember to change url with name at our localhost in table core_config_data so that it will not be redirected to customer’s site). After finishing setup, run it just like customer’s live site and move to step 3.
Noted: There is two methods in this step to choose. Using method B is safer but it takes time separating every single module to attach to new Magento version.
Step 3 – Method A
Copy code of version 1.7.x we have just downloaded and replace into customer’s code folder. After that, reload the site in order for new code to updrade database – this process needs a while for the site to do such things like remove unnecessary columns in the table or add new ones, even creat new tables. During this time, you should not load other pages on the site to avoid conflicts that may lead to more errors. (In this upgrading process, errors are unavoidable and for each of them there will be a different way to solve and surmount).
When it’s done, go to the frontend to check whether or not site’s functions operate normally as with customer’s current Magento version. If everything is ok, keep continuing with version 1.9.x similarly.
Step 3 – Method B
Copy code of version 1.7.x that we downloaded and create a new code folder named upgrade17x in xampp/htdocs (it could be any other name so as to be distinguished most easily). We leave still all code in this folder and do not copy modules from the old folder, which is only to upgrade database.
Copy file app/etc/local.xml from customer’s code folder and paste into code folder of version 1.7.x. Reload the site so that new code upgrades database (change url in core_config_data before loading site with new url, http://127.0.0.1/upgrade17x/ for instance). The site will need some time to upgrade and do not load other pages during this to avoid conflicts.
After finishing upgrade to 1.7.x and successfully upgrade database, check all functions at the frontend to see whether they work as default of the new Magento version. If they do, continue in the similar way with version 1.9.x and just do one more thing in the end: separate modules from the old code folder to install in this 1.9.x folder.
Now check again all functions and themes with those on customer’s old website. Fix all errors that appear after upgrade. Finally, move code and database of newest version up to the site
Export latest database on local (after finishing upgrade) and also the latest code. Then move all database and code onto the site at customer’s server. Do not forget to check it all one more time carefully before the site officially goes live.
After updating source successfully, there will be usually many errors, mostly due to website theme which is built based on the old Magento version. Functions after upgrade will change but theme still use the old ones, that’s when errors happen. Here is how to fix them: Compare codes, find out and fix differences in measures and method names; Check class and function rewrite of the old version and fix them in proper ways.
Common errors in Magento upgrade
- Errors from outside modules installed after upgrade
A cause migh be that class extend from core module doesn’t exist. It happen because of changes in file/folder structure in updated version: maybe file containing class has been moved to another folder, or functions in that class have been moved for another class to handle. For errors like this, firstly, we can google search for the solution (if it has been shared) or contact module providers to require new module version that supports latest Magento version. If not, we need to check again the old code to see what that extended class declares and what functions in that class handle, from which we will find the solutions.
- Errors from server
Maybe PHP version on server is too old that it can not repond to upgraded Magento version. So, server needs to be upgraded to the latest version to be compatible with new code
You see, there are perhaps countless ways that things can go wrong when manually upgrading Magento version for a website – errors that come from different kinds of causes. Discuss with us more if you like to find out the best solution for anything that still troubles you on practically upgrading Magento.