Before You Begin
Version Compatibility
- Upgrading from 2.x.x to 3.x+: Follow this guide
- Upgrading from 1.5.x: Contact OpenCart Dedicated Support for professional assistance
- Upgrading within same major version (e.g., 3.0 to 3.1): Follow this guide
OpenCart 3.x introduced Twig template engine replacing the older TPL format. Your custom themes will need updating when upgrading from 2.x.
Important Version Changes
2.x to 3.x Breaking Changes
2.x to 3.x Breaking Changes
- Template engine changed from TPL to Twig
- All view files need conversion
- Theme compatibility: OpenCart 2 themes will not work in version 3+
- Extension API changes require updates from developers
3.x to 4.x Breaking Changes
3.x to 4.x Breaking Changes
- Minimum PHP version increased to 8.0.2
- Namespace changes:
Opencart\{Application}\... - Updated dependencies (Twig 3.x, Symfony 7.x)
- Core structure improvements
Pre-Upgrade Checklist
Complete these tasks before starting the upgrade:- Backup your entire store (files and database)
- Verify current OpenCart version
- Check extension compatibility with target version
- Test upgrade process on staging/development site first
- Notify customers of potential downtime
- Disable all third-party extensions
- Switch to default theme
- Document current customizations
- Ensure PHP version meets requirements (8.0+ for OpenCart 4.x)
Step-by-Step Upgrade Process
Prepare Extensions
Check Extension Compatibility
- List all installed extensions in Extensions → Extensions
- Note extension versions
- Visit each extension developer’s website
- Verify compatibility with target OpenCart version
- Download updated versions if available
Disable Extensions
- Go to Extensions → Extensions
- Select Modules from dropdown
- Click Uninstall (red button) for each extension
- Repeat for Payment, Shipping, and Themes
Switch to Default Theme
- Go to Extensions → Extensions
- Select Themes from dropdown
- Enable the Default theme
- Click Edit and save settings
Backup Configuration Files
Create copies of your configuration files:
Never overwrite these files during upgrade—they contain your database credentials and paths.
Remove Old View Files (2.x to 3.x only)
If upgrading from 2.x to 3.x, remove old TPL template files:OpenCart 3+ uses Twig templates, so old TPL files will cause conflicts.
Upload New Files
Download Latest Version
- Download the latest OpenCart from GitHub Releases
- Extract the archive
- Navigate to the
upload/directory
Upload Files via FTP
Upload all other files, overwriting existing ones:What files to upload?
What files to upload?
Upload these directories and files:
/admin/(exceptadmin/config.php)/catalog//extension//image/(only new default images)/install//system//assets/index.php.htaccess.txt
config.phpadmin/config.php- Your custom images in
/image/
Run Upgrade Script
Access Upgrade Installer
Navigate to:Expected Behavior
✅ Correct: You see the OpenCart Upgrade screen❌ Incorrect: You see the OpenCart Install screenIf you see the install screen, you accidentally overwrote your config files. Restore them from backup and try again.Run Upgrade
- Click Continue or Upgrade button
- Wait for the upgrade process to complete (may take several minutes)
- Review any warnings or errors
Clear Browser Cache
- Clear all cookies in your browser
- Close all browser tabs
- Reopen browser
- Press
Ctrl+Shift+R(orCmd+Shift+Ron Mac) multiple times to hard refresh
Update Admin Permissions
- Login to admin panel
- Go to System → Users → User Groups
- Click Edit next to Top Administrator
- Check ALL boxes in both columns:
- Access Permission: Check All
- Modify Permission: Check All
- Click Save
Configure Theme
- Go to Extensions → Extensions
- Select Themes from dropdown
- Click Edit next to the Default theme
- Click Save (even if you don’t change anything)
Update Store Settings
- Go to System → Settings
- Click Edit next to your store
- Review all tabs for new fields
- Fill in any blank fields
- Click Save
Even if you don’t see new fields, always click Save to update the database schema with new field names.
Post-Upgrade Tasks
Reinstall Compatible Extensions
Install Updated Versions
- Download latest compatible versions from developers
- Upload extension files
- Install via Extensions → Installer
- Configure extension settings
- Test thoroughly
Update Custom Theme
If you’re upgrading from 2.x to 3.x+:- Twig Conversion Required: All TPL templates must be converted to Twig
- Hire a Developer: Unless you’re familiar with Twig, consider hiring professional help
- Theme Framework: Look for theme frameworks that support easy updates
Restore Custom Code
If you had custom modifications:- Review Backup Files: Check your pre-upgrade backup for customizations
- Reapply Carefully: Apply custom code to new files
- Test Thoroughly: Ensure modifications work with new version
- Use Version Control: Consider using Git for custom code management
Troubleshooting Common Issues
Upgrade Script Errors
Upgrade Script Errors
Symptoms: Error messages during upgrade processSolutions:
- Note the exact error message
- Search OpenCart Forum for similar issues
- Post in the version-specific upgrade thread
- Check official bug thread for known issues and fixes
- Restore backup and try again after resolution
White Screen After Upgrade
White Screen After Upgrade
Symptoms: Blank white page on admin or storefrontSolutions:Common causes:
- PHP version too old
- Missing PHP extensions
- File permission issues
- Incorrect config.php paths
Missing Products or Categories
Missing Products or Categories
Symptoms: Products disappeared after upgradeSolutions:
- Products are still in database, usually a theme/display issue
- Re-enable default theme
- Clear cache: System → Maintenance → Clear Cache
- Check product status (ensure they’re still enabled)
- Verify category assignments
Extension Not Working
Extension Not Working
Symptoms: Previously working extension now brokenSolutions:
- Uninstall the extension completely
- Download updated version compatible with new OpenCart version
- Reinstall fresh copy
- Contact extension developer if still broken
- Consider alternative extensions
Theme Issues
Theme Issues
Symptoms: Layout broken, missing styles, odd appearanceSolutions:
- Hard refresh browser:
Ctrl+Shift+R - Clear browser cache completely
- Disable browser extensions
- Switch to default theme to isolate issue
- Check for Twig template errors in logs
- Contact theme developer for updates
Database Errors
Database Errors
Symptoms: SQL errors during or after upgradeSolutions:
- Restore database backup
- Re-run upgrade script
- Check MySQL error logs
- Ensure database user has full permissions
Version-Specific Considerations
Upgrading to OpenCart 4.x
PHP 8.0+ Requirement
PHP 8.0+ Requirement
OpenCart 4.x requires PHP 8.0.2 minimum:Contact your hosting provider if you can’t upgrade PHP yourself.
Composer Dependencies
Composer Dependencies
Dependencies are now managed via Composer:The vendor directory is located at:
upload/system/storage/vendor/Upgrading from 2.x to 3.x
Template Engine Change
Template Engine Change
Major Change: TPL → Twig
- All view files must be converted
- Custom themes require complete rewrite
- Extension view files need updates
- No automated conversion tool available
Best Practices
Plan for Downtime
- Schedule upgrades during low-traffic periods
- Enable maintenance mode
- Notify customers in advance
- Have rollback plan ready
Document Everything
- Record current versions of all extensions
- Document custom modifications
- Keep upgrade notes
- Screenshot important settings
Rollback Procedure
If upgrade fails and you need to rollback:Getting Help
If you encounter issues during upgrade:- Check Official Resources:
-
Community Support:
- Post in version-specific upgrade threads
- Include: OpenCart version, PHP version, error messages
- Provide error log excerpts
-
Professional Help:
- OpenCart Dedicated Support
- Hire certified OpenCart developers
- Extension developers can help with their products
Post-Upgrade Optimization
After successful upgrade:Performance Tuning
- Enable caching
- Optimize images
- Review server resources
Security Hardening
- Change admin directory name
- Update all passwords
- Review user permissions
Testing Checklist
- Test checkout process
- Verify payment gateways
- Check email notifications
Backup Strategy
- Schedule automatic backups
- Test backup restoration
- Store off-site copies

