Welcome Guest, Not a member yet? Register   Sign In
Upgrade from 1.7.2 to 2.1.0
#1

[eluser]Fred Riley[/eluser]
Hi

A minor Q: to upgrade from 1.7.2 to 2.1.0, should I go 1.7.2 => 2.0, then 2.0 => 2.1.0? If not, is there anything I should watch out for if going from 1.7.2 => 2.1.0 directly? I suspect it's the first as I see that the /application folder has now moved outside /system. I've looked at the helpful upgrade notes in the fine manual but there's no direct 1.7.2 => 2.1.0 route listed.

Sorry, I've been away from CI for a good year or more Sad

Cheers

Fred
#2

[eluser]CroNiX[/eluser]
You can upgrade the files straight across, but will still need to follow each step in the upgrade guide moving from the previous version to the new.
#3

[eluser]CroNiX[/eluser]
Just be aware that previous to CI 2, the /application directory was located within the /system directory. Now they are separate and at the same level.
#4

[eluser]InsiteFX[/eluser]
And dont forget to copy the new index.php file over into your root.
#5

[eluser]Fred Riley[/eluser]
This is just to say a belated thanks for both of your replies, which are helpful. I'll give it a go with an earlier project I developed in 1.7. If I can't get the upgrade to work ok is it safe to keep the project in 1.7? Have there been any important security updates between 1.7 and 2.1, or would I just be losing out on extra features/classes if I didn't upgrade it.

I've been playing around today in 2.1 and there are significant coding differences that make me think that my old code might break if I upgraded to 2.1. For instance, the constructor call:

Code:
parent::Controller();

fails with a 500 error, and needs to be:

Code:
parent::__construct();

I've a feeling that there might be a few other bear traps to fall into.

Fred
#6

[eluser]CroNiX[/eluser]
Yes, but most changes can easily be done using a simple search and replace, like your "parent::__construct()" example. Since we are using PHP5 now and removed the PHP4 compatibility layer, some of these changes are necessary. There really aren't that many things that need to change and the ones that do are fairly simple.

The other major changes are that Controllers extend CI_Controller (instead of just Controller) and the same with models, they extend CI_Model instead of just Model. Again, very easy to do with search and replace. You can do your whole project with a single search/replace rather than all of the individual files. For most of my old apps that were upgraded, it took under an hour, depending on app complexity of course. Some were literally 10 minutes.
#7

[eluser]Fred Riley[/eluser]
Thanks again. Search + replace for class names is simple enough.

Cheers

Fred




Theme © iAndrew 2016 - Forum software by © MyBB