How can I upgrade from CI3 to CI4.

How can I upgrade from CI3 to CI4?

You must update your code and configuration files in order to upgrade from CI3 to CI4. Web searches at https://codeigniter.com/user_guide/installation/upgrade_4xx.html revealed this.Some of the procedures are listed in the question at https://stackoverflow.com/questions/70716676/upgrade-ci3-to-ci4-configuration-files:

• To comprehend the updated features and modifications, read the CodeIgniter 4 user manual.

Use Composer, a tarball, or a zip file to install CodeIgniter 4.

• Download and install the ci3-to-4-upgrade-helper tool. This programme assists you with routine activities like renaming files and folders, altering namespaces and class names, and more.

• Modify the default CI4 configuration files’ values in accordance with the modifications made to the CI3 files. Most of the configuration names are carried over from CI3.

• If your CI3 project has customised configuration files, your CI4 project requires the creation of new PHP classes.

• If you have custom config files in your CI3 project, you need to create new PHP classes in your CI4 project in app/Config that extend CodeIgniter\Config\BaseConfig. Then copy the variables from the CI3 config files into the new CI4 config classes as public properties.

• Change the config fetching syntax everywhere you fetch config values. The CI3 syntax is something like $this->config->item(‘item_name’);. You need to change this into config(‘MyConfigFile’)->item_name;.

• Upgrade the migration table definition and its data if you use the same database for both versions. You can migrate the database with a simple CLI command: php spark migrate.

  1. Update your CodeIgniter files. …
  2.  Update your classes file names. …
  3.  Replace config/mimes. …
  4.  Remove $autoload[‘core’] from your config/autoload. …
  5.  Move your Log class overrides or extensions. …
  6. Update your Session library usage.
Scroll to Top