• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Upgrade From Version 2.1.3 To Version 3.1 or 4

#1
Hi,

We have a RESTful web services API developed in CodeIgniter Version 2.1.3 and hosted of ISP server. Now our ISP want to upgrade the PHP and MySQL (to latest version) on that server and not sure if these upgrades will work with our CodeIgniter Application. We are in process of rewriting this application in some other language but still want to keep it up for next 3-4 years for backward compatibility for our existing customers. 

I will really appreciate if someone will help me to determine what's the best option for us to keep it running without having any issues for next 3-4 years with latest PHP and MySQL. We are not planning to do any new development to this site, except the regular maintenance and bug fixes. 

At this time I have following 3 options, but not sure which one is the best to keep my application running for next 3-4 years without any more interruptions:

Option 1 - Just upgrade PHP and MySQL and keep application running in CodeIgniter 2.1.3 (not sure if it's compatible or will create any issues)

Option 2 - Upgrade to Version 3, but in that case I have to go through multiple 3 migration process (from 2.1.3 to 2.1.4, 2.1.4 to 2.2.x and then 2.2.x to 3.0.x) - Preferred (but just need help about the steps involved)

Option 3 - Upgrade to Version 4, but in that case I have to pretty much rewrite the whole application as we have no plans to keep that application running after 3 -4 years therefore I think at this time Option 2 is the best option.

Thanks,
SauGo
Reply

#2
Hello, version 2.1.3 wont work on PHP 7, as for the upgrade, it is easier to upgrade to 3 (not that radical of a change) but i would recommend version 4.

It may not even be that much work, pretty much the "top" of the files (Controllers, Models, etc) changes (check provided examples on downloaded framework).
The calling of methods (for databases for example) change from like:
- $this->db->order_by("x"); to $this->db->orderBy("x");
- $this->input->post is now $this->request->getPost
- $this->load->model('model_x') -> $model = new \App\Model\Model_x();
- etc
You can probably do most of it with a Find and Replace (just make sure you re-check).
Reply

#3
- Yes, I will go for option 2, for many reasons: 
  • CodeIgniter 3.1.11 work great with the latest PHP & MySQL version, 
  • CodeIgniter 3.1.11 is very stable,
  • Less work for the upgrade
- CodeIgniter 2, does not support the latest PHP version,  I think does not support PHP 7.x and up

- CodeIgniter 4, you need to rewrite lot of thing, maybe everything
Reply

#4
Also 10 to 1 your rest will not work and also needs to be upgraded.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#5
(11-05-2020, 03:07 PM)Eskiso Wrote: Hello, version 2.1.3 wont work on PHP 7, as for the upgrade, it is easier to upgrade to 3 (not that radical of a change) but i would recommend version 4.

It may not even be that much work, pretty much the "top" of the files (Controllers, Models, etc) changes (check provided examples on downloaded framework).
The calling of methods (for databases for example) change from like:
- $this->db->order_by("x"); to $this->db->orderBy("x");
- $this->input->post is now $this->request->getPost
- $this->load->model('model_x') -> $model = new \App\Model\Model_x();
- etc
You can probably do most of it with a Find and Replace (just make sure you re-check).

Thanks for your prompt reply Eskiso and as I mentioned we only want to keep this application for another 2-3 years and no more new development therefore it's not cost effective to rewrite the whole application in CodeIgniter 4. If CodeIgniter 3 upgrade process is simpler with minimal changes and will work with latest PHP7 and MySQL then will go with it. The only think not clear is do I have to go through multiple upgrade steps (e.g. From 2.1.3 to 2.1.4, next 2.1.4 to 2.2.x and then 2.2.x to 3.x.x) or I can directly upgrade from 2.1.3 to 3.x.x.

Thanks,
SauGo
Reply

#6
(11-05-2020, 06:15 PM)Halim Wrote: - Yes, I will go for option 2, for many reasons: 
  • CodeIgniter 3.1.11 work great with the latest PHP & MySQL version, 
  • CodeIgniter 3.1.11 is very stable,
  • Less work for the upgrade
- CodeIgniter 2, does not support the latest PHP version,  I think does not support PHP 7.x and up

- CodeIgniter 4, you need to rewrite lot of thing, maybe everything

Thanks Halim and agreed Option 2 is the most cost effective and faster approach as we don't have to rewrite the whole application due to the major changes in CodeIgniter 4 framework. The only thing not clear is do I have to go through multiple upgrade steps (e.g. From 2.1.3 to 2.1.4, next 2.1.4 to 2.2.x and then 2.2.x to 3.x.x) or I can directly upgrade from 2.1.3 to 3.x.x.

Thanks,
SauGo
Reply

#7
(11-05-2020, 09:34 PM)InsiteFX Wrote: Also 10 to 1 your rest will not work and also needs to be upgraded.

Thanks InsiteFX, we are using REST_Controller (https://github.com/chriskacerguis/codeig...restserver) version 2.6.2 and also Grocery Crud (http://www.grocerycrud.com) version 1.3 in our existing application and may need and upgrade too. But thanks for mentioning.

- SauGo
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.