Update django 1.8 project to 2.0 lts

45 views
Skip to first unread message

David Brown

unread,
Sep 23, 2018, 9:57:03 AM9/23/18
to Django users
I have a large django project built in 1.8 with about 14 apps and a large amount of dependencies.

I already have a good idea about how I'm going to update the 2.7 code to 3.6 or possibly just make it compatible with both, however, I'm not sure what is the best practice and most efficient way to refactor/upgrade the django framework to 2.0 from 1.8.

Bare in mind this thousands of lines of code so efficiency in terms of work is crucial.

Thanks in advance for all suggestions!

Jani Tiainen

unread,
Sep 23, 2018, 10:09:01 AM9/23/18
to django...@googlegroups.com
I suppose you do have good unittest code coverage so do gradual upgrades (which is preferred upgrade path) and read release notes on each version.

2to3 tool is great help to check some obvious issues when upgrading to Python 3.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d6307d12-8920-434b-b5ec-e9b72c0c3443%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Message has been deleted

Mike Dewhirst

unread,
Sep 23, 2018, 8:09:03 PM9/23/18
to 'David Brown' via Django users
I suggest bringing the Django code only as far as 1.11 in Python 2.7.
Django 1.11 is a LTS version.

Then I would advance the same code to Python 3.x and get that working as
a separate ring-fenced project. You can do that away from production or
using six and other dual-Python tricks you can also deploy 3.x code to
production. I have been writing in 3.x and deploying in 2.7 for quite
some time. One of these days I'll switch the production server to
Python3 and drop 2.7.

Only with Django 1.11 and Python 3.x working properly in production will
I advance to the next Django 2.x LTS version

Oh, and heaps of tests :)

hth

Mike

carlos

unread,
Sep 23, 2018, 9:41:52 PM9/23/18
to django...@googlegroups.com
Django 2.0 Not LTS warning!! the next LTS Django version is 2.2

Cheers

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

For more options, visit https://groups.google.com/d/optout.


--
att.
Carlos Rocha

Jason

unread,
Sep 23, 2018, 10:05:12 PM9/23/18
to Django users
django 2.x is not lts, next LTS version is 2.2, as said before.

That said, I'd break this into three chunks:

migrate 1.8 to 1.11
migrate 2.7 to 3.6 (or 3.7)
migrate 1.11 to 2.1 or 2.2, depending on the timing.  2.2 will be out in April 2019, which is seven months from now.

I would separate framework update from python version update to minimize bugs and simplify the upgrade process.

Andréas Kühne

unread,
Sep 24, 2018, 4:08:48 AM9/24/18
to django...@googlegroups.com
Hi,

My experience is that the best thing to do is to do minor upgrades - 1.8 -> 1.9.x -> 1.10.x -> 1.11.x (where x is the last patched version of each minor version). The reason for updating in this fashion, is that when you start the server on each version, you will get warnings about unsupported changes in the upcoming releases.

And of course - having a good test suite will be essential for upgrading successfully. 

When you have done the django upgrade, I would then do the python upgrade (just like others have suggested). Doing both at the same time will just become a huge task....

And of course - like others have also stated - django 1.11 is the LTS version, not 2.0. Upgrading to 2.0 is only necessary if you need the features that 2.0 includes (which is mainly changing to a different structure to the urls files and also deprecating python 2).

Good luck!

Regards,

Andréas


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Bill-Torcaso-Oxfam

unread,
Sep 24, 2018, 11:16:38 AM9/24/18
to Django users

I strongly recommend this approach:

My experience is that the best thing to do is to do minor upgrades - 1.8 -> 1.9.x -> 1.10.x -> 1.11.x (where x is the last patched version of each minor version).

Further, at the completion of one Django version, I recommend saving a snapshot of your database at that moment, and then starting the next upgrade in a new GIT branch :

Git branches:

mycode_django_1.8    #  Working version under 1.8
mycode_django_1.9    #  Working version under 1.9
mycode_django_1.10  #   ...
mycode_django_1.11  #   ...
 
Reply all
Reply to author
Forward
0 new messages