Overview:
This question was originally asked and later closed on StackOverflow. We stated in meta, that here is the right place for this question.
This question is in favor to help to many people to find the proper way to estimate the Magento upgrades.
The question:
I am interested to know how do you measure the needed time for Magento upgrade?
I guess, that most of you had hard time to answer on the client's question: "How long it will take to upgrade my Magento store?"
Usually the client needs to hear just a number for e.g.:
"It will take X hours and it will cost Y bucks."
The main idea behind the question is about the technical side
and what do you check as developer to make your own calculations for Magento upgrades.
I created the next check list, just for my own calculations:
- Is the Magento core touched?
- Is the Magento DB schema touched?
- Do we have inconsistent data in the DB?
- How many custom extensions are installed in local and community code pool?
- Are the custom extension compatible with the latest version of Magento?
- Did the theme developer used local.xml file for the the layout directives,
or just copied xml files from the base/default/layout to the layout directory
of the custom theme? - Do we have deprecated layout directives / block methods in the layout xml files?
- Have I developed this Magento shop?
Do you think, that I am missing something and if yes, would you like to share with me and the community your additional points for the check list?
Best Answer
Estimating Magento upgrade is a process of collecting information about the modifications applied to the installation you are about to make up-to-date, checking if those modifications can cause a problem and then evaluating how much time is required to work around them.
All modifications can be literally divided into off-core and in-core.
Off-core modifications are those which will not be overwritten with upgrade. Those are 3rd-party extensions, core files put into local scope (app/code/local/Mage) and a custom theme.
In-core modifications are applied directly on Magento core files (app/code/core), localization files (app/locale/en_US), core templates and some things like javascripts, external libraries which are rarely customized nevertheless have to be taken into consideration.
Off-Core Modifications
3rd Party Extensions
During upgrades 3rd party extensions are the main source of issues. Which means more extensions you have more time you will need to analyze them.
The first thing to check is if the functionality provided by the extension is not yet implemented in a version of Magento you are upgrading to. For example some extensions like
Yoast_CanonicalUrl
,Mxperts_CustomerAddress
orFontis_Wysiwyg
were widely used in Magento 1.3.x.x and older but now are part of core Magento functionality and no longer required.Then it is a good idea to check (ask your customer) if you really need all those extensions you have. There might be some extensions you installed but never really used. So at this point it is good to make a sort of cleanup.
Then an important thing to check is a compatibility of each of remaining extensions with a version of Magento you are upgrading to. In case some extensions are not compatible and no similar extensions are available you will have a hard choice of either losing some functionality or modifying existing extensions to make them compatible.
After all those done the actual analysis of each of remaining extensions can be provided. It shall always start with examination of
etc/config.xml
file. There are 3 things to look for:app/code/local/Mage
After you finished with your extensions it’s time to take a look at your
app/code/local/Mage
directory. Here you will find modified core files moved into alocal
scope. Each of them will surely cost you some grey hair because you never know (if it was not you who put them there) what was modified there and for what reason. So you have to compare each of them with an origin and migrate added functionality to correspondent file of the new version.Custom Theme
The last bunch off-core modification is the custom theme. This may seem to be not a big deal but in fact this is a grey area. Magento base theme is being modified from version to version and each custom theme has to mimic some of those modifications. Unfortunately there is no silver bullet to determine what to look for and what have to be migrated. So just be prepared for some major surprises and minor nitpicking after your upgrade.
In-Core Modifications
In the perfect world there are none. But when you got a Magento installation after it has been abused by third-party developers, who are offering much for cheap you can expect anything. So in-core modifications are those which will be overwritten during the upgrade process. In most cases it will not produce any errors but as a result you will lose the functionality that was added in such a brutal way.
The only way to detect in-core modifications is to compare all files of your Magento installation with a clean files of the same version. I recommend doing it with git. Why? Simply because it will handle all newlines and whitespaces nicely.
Even if your Magento installation is not under git you can still copy your files into a separate directory and then run git init. Then make initial commit, copy “clean” Magento files over and run
git status
. You will get something like this:Now depending on the number of modified files you can run
git diff
on each file or on the whole batch at once. This will give you a comprehensive reference of all in-core modifications made. If you have any git visualisation such as phpStorm the life is way much easier to you:I suggest to do
git diff > changes.txt
so you will always have a list of modifications by hand.Having the list of core modifications you can estimate what have to be transferred into new version and how much time will be required to do so.
Now I would like to give some advises for an actual upgrade. This process is well documented so I will not write what commands to run and where to click. However I want to make an accent on several important things:
dataflow_*
,log_*
,report_*
.After upgrade script completed:
changes.txt
you made before migrate all in-core modifications which are really worthy migrating.app/code/local/Mage
modifications found before upgrade.Conclusion
I know this all sounds scary but if you are upgrading regularly, keeping your core clean and installing extensions only from vendors you really trust and only if you really need them you will not face most of the hardships described in this article. Keep your Magento EcoSystem healthy and you will be rewarded.
Post Scriptum
In very complicated cases it makes sense to start all over with a fresh install of latest Magento and migrate your store theme and functionality step-by-step. This will definitely take time but in the end you will have a healthy Magento system with your full awareness of what is going on.