I have one old CodeIgniter 2 project.
How do I update/upgrade it to CodeIgniter version 4 without any code or function change?
Is it possible?
I have one old CodeIgniter 2 project.
How do I update/upgrade it to CodeIgniter version 4 without any code or function change?
Is it possible?
On
There is no upgrade path to go from version 3 to 4, especially if you do not want to do any code or function changes, but I disagree that there is no point to upgrading to version 3. Actually, you will be unable to upgrade to even CI 3 without code or function changes. That ruled out, meaning you HAVE to change code or functions, the following might help.
Before you cut your losses and redevelop as suggested, using the below work from Kenji a shot might help. But to do so, you need to upgrade to CI 3 first. Kenji is a very accomplished CI developer with lots of contributions to the framework, including a PHP Unit wrapper for CI. You could follow the guides and upgrade to version 3, and then try to use this: https://github.com/kenjis/ci3-to-4-upgrade-helper/tree/1.x/src/CI3Compatible
The steps to upgrade from version 2 to version 3 may be a big job as well, the biggest one being the initial step - not saying it is going to be easy, but if you try this, and it is not working for you, redeveloping might be your last resort.
For completeness, CI 3.1.13 has been released, and CI is thus now PHP 8.1.3 compatible. The upgrade process from 3.1.11 that I had in my projects to 3.1.13 was literally as easy as 1-2-3.
There is no point in upgrading from 2 to 3 since at the end of the day you won't be able to smoothly upgrade from 3 to 4.
It's a poor time and labour cost calculation advising you to go through two (2 -> 3 -> 4) framework versions if you can efficiently move straight/directly to the latest version. Upgrading a framework alone consumes time, labour and comes with its own set of bugs.
Just come to terms with your current situation that a complete project rewrite directly to CodeIgniter 4 may be necessary. Nonetheless, you may be able to save some parts of your old project.
Upgrading from 3.x to 4.x
CodeIgniter 3 is in maintenance mode, receiving mostly just security updates.