How to upgrade from one Symfony2 distribution to another

Found out that upgrading from one Symfony2 version to another, is far from trivial. Especially finding the right version of third party bundles, which work with the Symfony2 version you are currently using, might be tricky. Here is how we do it, feel free to make some suggestions for improvements:

Our whole project lives in a git repository on our server.
We have defined some ignores in .gitignore (such as vendor/).
To work on the project we clone it from the server (git clone ...)

To merge the most up-to-date version of symfony-standard i add the symfony-standard master branch as remote to the repo:

git remote add symfony github.com/symfony/symfony-standard.git

Then i fetch the contents of symfony-standard

git fetch symfony

Then i checkout the according version of symfony-standard, lets say BETA4

git checkout v2.0.0BETA4

then i create a new branch for that version

git checkout -b beta4

I switch back to master

git checkout master

I merge the beta4 branch into master

git merge beta4

Then i get some conflicts (but not many:) i fix them in netbeans by right-clicking on my project and selecting "git/resolve conflicts"
After the conflicts are resolved, i check the current deps file. This step is only necessary if you use third party bundles (e.g. FOSUserbundle). The deps file contains the version of the bundles which are compatible with the current distribution of symfony-standard. For each distribution there is a deps file. I open the 2.0.0BETA4.deps and my previous deps file 2.0.0BETA3. I copy the lines which i added to 2.0.0BETA3 and paste them into 2.0.0BETA4. Then I update the vendors:

rm -rf vendors/*

./bin/vendors.php

This takes quite a while. After that I do propper testing. This is the point where incompatibilities between bundle versions show up. I try to find the right versions of the bundles (which work together) and update my bin/2.0.0BETA4.deps file.
After the tests run through, i commit the merged version. Finally i push it to the server. After all you have to tell your dev-team that there is a new symfony-standard version used, so they know that they will have to update there vendors after pulling from the server.

 

 

blog comments powered by Disqus