CodeIgniter Forums

Full Version: CI v2.1.2 to v3.1.5 Upgrade Problems
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to get a developer to upgrade our current CI application that was abandoned from v2.1.2 to v3.1.5. I am the front-end developer and owner of the application. The developer is not the original developer but has spent about a year in the application but has been away from it for several years. He is hesitant about upgrading it so, I am trying to get others initial thoughts (I know it's difficult to say for sure without seeing the code). Also to note, we were running php v5.4 but the server was updated to v5.6 and now the application does not work. Here are his reasons he is saying he would rather start from scratch rather than to try and do the upgrade, as most devs would but mind you there were years of development and a lot of money on dev time spent already:

1) The code written in current CI version of is not according to the standards followed by that framework. There could be many places which are difficult to identify which code is placed where. For eg. In some cases the code is written in CI libraries and if we upgrade CI version then that code will not work, and I am not sure why that code has been written.

2) The new version of CI will have a little different syntax than our version as it was written years back. Hence it will be difficult to identify and change syntaxes in this large code.

3) When we will upgrade the CI, we will surely need to upgrade the PHP version too, which means we need to change some PHP syntaxes too which has been deprecated by newer versions of PHP. I have already explained this to you by showing an example above where "&" sign before some kind of objects/variables are not needed now. If we keep it, then it creates an error.

4) The biggest problem is removing memcache from the libraries. The last time when I was working on it, I tried to disabled memcache from the controllers and models and it was somehow working for us. But removing memcache from the libraries' code is something I cant comment, as I have never done that before. This might create a problem when we upgrade to newer CI as all the libraries and CI internal files will change.

I don't want to be very negative about it and finding only mistakes in the code, but honestly speaking, currently I am really not sure what would be the ideal way to take this forward. Whether we should spend time and change the current code or we should start from scratch.

Although, I can tell you pros and cons of both

Pros of using same code :
1) If we can fix the current code, then there are many functionalities & logics which we can reuse and we don't have to develop them from scratch.
2) It would be one step forward towards our goal if we can do these fixes in lesser time.

Cons :
1) The code is not structured, so there could be performance issues.
2) To fix that code we need to spend a lot of time to first study the code and before that we need to upgrade it so that it can actually run and we can see where it is causing problems. But to do that I can't estimate how much time is required.

Pros of developing it new
1) We can do it in new, advanced & structured way.
2) We can release some lesser functionality but yet working MVP in fix time.
3) The performance would be surely better with this.

Cons
1) It could or could not cost you more than using the same code.
2) We need to develop all functionalities from scratch
Depending on the size of the project and the cost in creating it new I would try the migration first.
Its not that difficult its more all the little changes so you have to be very methological in the apprpoch.

I have done serveral migreation. PM me and I can either give you some guidance or offer to do the work.
The guide to upgrading is here:

https://www.codeigniter.com/user_guide/i...e_300.html

Have a read through and see if the developer's concerns match the upgrade issues listed.  I would, honestly, devote a small project to just doing what the update suggests and then seeing where you're at for problems in the site (clone the code base and branch off to an "upgrade" project so your existing code isn't touched) - the concerns may be justified or it may turn out to be a less problematic update.  Having done a v2 to v3 update on a huge custom project, we didn't spend more than a month on it (really trying to remember if I even spent more than a week on it) - and we have a significant amount of legacy, non-CI, code mixed in with CI.  The most annoying thing was the Ucase on the class names....
I think the migration guide is thorough and clear. I did migrations with some assisting tools:

1) If you are on Window , get something like Windiff or similar then compare the two directories say CI_old and Ci_new or whatever you want to call them
Or if you are on Linux or Mac then 'meld' is an alternative for Windeiff
By doing comparison on directories , the tool will point out the differences between old and new

2) You then can merge them together by carefully selecting the legacy codes you want to keep on Ci_new

3) At the end of process , then you can do SVN add /commit depends on the changes you made
OR git add / commit

Those are approaches I employed to successful migration. As Kaosweaver said, I found the changes in class names are much annoyed but you dont have other options
I built little script in perl so it go and check class name in Controlllers / Models / Libraries and made the changes with little effort

Good luck
Thanks everyone for the replies as they have been most helpful! I hope to do the migration and will give an update on how it went.