Upgrading Mezzanine from 1.4.10 to 1.4.16 then 3.0.9

(Comments)

If you are seeing this it means the upgrade (mostly) worked!

Mezzanine 1.4.10

I have stopped keeping up with updates since early August 2013 and when I got back to the Mezzanine website I was surprised it was now a 3.x version! Got reliefed when I saw they skipped 2.x... But I was still more than 10 releases behind!

Well, those were the steps and issues I faced:

I was afraid to jump straight to 3.x, but also too lazy to take several mini-upgrades. So I decided to try a stop on the last 1.x (1.4.16), test thoroughly (not really), and then move to the current version.

When on 1.4.10 my requirements file was like this:

Mezzanine==1.4.10
PIL==1.1.7
South==0.8.2

Mezzanine 1.4.16

So I changed only the Mezzanine line to 1.4.16, created a new virtualenv and pip installed it. I got gifted with an unasked upgrade to Django 1.5.5 -- Let's see what happens.

Second surprise: no PIL! Where is PIL? PIL was nowhere to be found! Panic and despair! After breathing I researched a bit and found a new egg with a suspiciously reminiscent name: Pillow. Replaced the PIL line with Pillow==2.3.0 and pip installed again.

Virtualenv built! Success!! ./manage.py syncdb --migrate and run! ... and fail! Complaints about the 'future'... Future? No Future! Added future==0.11.3 to the requirements. Well, everybody needs future! Now runserver worked! But when I tried editing anything I got:

  AttributeError: 'NoneType' object has no attribute '__name__'

Checking the stack traces I noticed the problem was related to html5lib. The dependency was html5lib 0.9, I manually pip installed 0.999: it then worked!

Nice! Time to git commit!

Mezzanine 3.0.9

After all this pain moving to Mezzanine 3.0.9 was:

pip install Mezzanine==3.0.9 # no --upgrade to avoid django 1.6
./manage.py syncdb --migrate
./manage.py collectstatic

... aaaand: nothing! Everything worked! Too much planning for no issues... bummer!

Bonus: Django 1.6.2

Now try to move to django 1.6... the coveted app breaker!

pip install --upgrade django
./manage.py syncdb --migrate
./manage.py collectstatic
./manage.py runserver

After all this fiddling my requirements file is now a bit longer:

Mezzanine>=3.0.9
Pillow>=2.3.0
South>=0.8.4
future>=0.11.3
html5lib>=0.999

Noticed the overly optimistics ">="? :-)

Again the surprise was: No surprises! No, not true... layout is a bit broken! Worse defect: accordion not working for blog editting. Time to review stylesheets and I am NOT a designer...

Unintended Bonus: Bootstrap

For this site I was using a free Bootstrap 2 theme from Bootswatch, the Slate.

Now with the upgrade to Mezzanine 3.0.9 guess what? They moved to Bootstrap 3! So I was forced to move up too. Luckly Bootswatch also upgraded their Slate theme to Bootstrap 3. Thanks guys!

As nothing is perfect I was forced to do some CSS fiddling to fix minor glitches and add mezzanine.css and bootstrap-theme.css to my customization. When deploying on production I spent some head scratching minutes wondering why my changes were not there -- it happened because I forgot to ./manage.py collectstatic.

And that is it! My toy website and blog got upgraded on the fast moving web landscape!

Update: later I learned that bootstrap-theme.css was intended for backwards compatibility with Bootstrap 2, as my html has already been converted to BS3 I got rid of it.

Current rating: 4.5

Comments