Upgrade Chamilo 1.9 to 1.11 through Git

If you are a developer or system administrator and you (wisely) manage some Chamilo portals through Git, you might want to upgrade, at some point, from Chamilo 1.9(.x) to Chamilo 1.11(.x). This is a complex process, for many reasons, so let me drive you through it.


Before doing this, please take a backup of your files and database!


To avoid terminally breaking your current Chamilo portal, a good precaution is to start a new branch.
git checkout -b 1.11.x

Pulling the new code

Now, the biggest issue with pulling the code from 1.11.x is you have to pass through 1.10.x first. Otherwise, you'll get something like this:
warning: inexact rename detection was skipped due to too many files.
Automatic merge failed; fix conflicts and then commit the result.
So, too many file changes, and Git stops executing the pull. To avoid it then, do the following:
git pull origin 1.10.x
git reset --hard origin/1.10.x
git pull --force origin 1.11.
This should have pulled the new code correctly.

Update dependencies

Now the last step (before the web interface upgrade) is to update your dependencies. This is taken in charge by composer but it might take a while to execute.
composer update
With all this done, you can now proceed to the upgrade interface. To avoid some weird style issues, load directly the http://domain/main/install/ URL, and follow the steps of the interface. Bear in mind that 2 different upgrade procedures will take place one after the other, so this might take a long time on large portals.