georgechitechi / upgrader
A tool to upgrade CodeIgniter 3 projects to CodeIgniter 4
Installs: 18
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/georgechitechi/upgrader
Requires
- php: ^7.4|^8.0
 - symfony/console: ^5.4|^6.0
 - symfony/filesystem: ^5.4|^6.0
 - symfony/finder: ^5.4|^6.0
 
Requires (Dev)
- phpunit/phpunit: ^9.0
 - squizlabs/php_codesniffer: ^3.6
 
This package is auto-updated.
Last update: 2025-10-05 20:37:15 UTC
README
This package helps you upgrade your CodeIgniter 3 projects to CodeIgniter 4. It handles the migration of your project structure, namespaces, and various CodeIgniter-specific components.
Installation
Install the package in your CodeIgniter 3 project:
composer require georgechitechi/upgrader
Usage
Simply run the upgrade command from your CI3 project directory:
vendor/bin/ci-upgrade
The upgrader will:
- Use your current directory as the source
 - Create a backup of your entire project
 - Download the latest CI4 and set it up
 - Migrate all your code to CI4 format
 - Place the upgraded project in a new directory
 
vendor/bin/ci-upgrade upgrade
If you want to upgrade a different CI3 project, you can specify the path:
vendor/bin/ci-upgrade upgrade --path=/path/to/other/ci3/project
What Gets Upgraded
The upgrader handles the following aspects of the migration:
- 
Project Structure
- Downloads latest CI4 installation
 - Creates proper directory structure
 - Creates a backup of your original project
 
 - 
Controllers
- Adds namespaces
 - Updates class extensions
 - Updates method visibility
 - Converts CI3 syntax to CI4
 
 - 
Models
- Adds namespaces
 - Updates class extensions
 - Updates method visibility
 - Adds CI4 model properties
 
 - 
Views
- Migrates to the new location
 - Updates echo syntax
 - Updates form helper syntax
 - Updates URL helper syntax
 
 - 
Configuration
- Converts config arrays to classes
 - Updates config file structure
 - Migrates database configuration
 - Sets up environment file
 
 - 
Routes
- Updates routing syntax
 - Migrates to the new routing system
 
 - 
Helpers and Libraries
- Adds namespaces
 - Updates file locations
 - Updates syntax to CI4 standards
 
 - 
Composer Configuration
- Creates/updates composer.json
 - Sets up autoloading
 - Preserves existing dependencies
 
 
After Upgrade
Your upgraded project will be in a new directory next to your current project.
The original project will remain untouched, and a backup will be created with the suffix _backup_YYYY-MM-DD_HH-ii-ss.
Important Notes
- Always commit your changes before running the upgrader
 - Review the upgraded code manually to ensure everything works as expected
 - Some manual adjustments might be needed after the upgrade
 - Test your application thoroughly after the upgrade
 
Manual Steps After Upgrade
- Review and update any third-party libraries
 - Update any custom helpers or libraries that might need adjustments
 - Test all forms and file uploads
 - Update any custom database queries
 - Review and update any session handling
 - Test all AJAX calls and responses
 
Known Limitations
- Custom libraries might need manual adjustment
 - Complex routing configurations might need review
 - Database queries might need updates for compatibility
 - Session handling might need manual updates
 - Custom hooks will need manual migration
 
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Author
George Chitechi
License
MIT License