How to Update OpenCart Core and Modules Without Headaches
Why Updating OpenCart Is a Headache for Site Owners
A client updated OpenCart 2 to 3 and the payment gateway broke because the order_status API changed. Orders stopped flowing into the system. Without experience, you'd lose weeks. We solved it in a couple of hours. With over 5 years of OpenCart experience and 30+ successful update projects, we know that a proper approach eliminates downtime and yields a secure, fast store. OpenCart Official Documentation recommends backing up before any update. Timely updates can reduce support costs by up to 30%, saving $300–$500 annually. Our team brings a decade of e-commerce development experience.
Problems We Solve
Backup and Risk Mitigation
Without a full backup, you risk losing customer data and order history. We use rsync for files and mysqldump for the database, storing snapshots on a separate server. This allows a rollback in 15 minutes. Run these commands on your server:
# Backup files and database tar czf /backups/opencart-$(date +%Y%m%d).tar.gz /var/www/shop.com mysqldump -u root opencart_db > /backups/opencart-db-$(date +%Y%m%d).sql Two main risks: losing customizations and module incompatibility. OpenCart uses OCMOD modifications stored separately from the core. Simply copying a new version over does not break OCMOD, but conflicts can arise. The second risk is the database: migration may timeout. Our engineer always checks the SQL error log.
How We Do It: A Real Case
In our practice, one client ran an OC2.1.0.1 store with custom OCMOD tweaks for payment and shipping. They attempted a manual upgrade to OC3.0.2.0, and all modifications broke due to changes in the order API. We:
- Restored from backup.
- Analyzed each OCMOD file and updated the modified API calls.
- Tested the checkout flow with staging data.
- Deployed with only 2 hours of planned downtime—instead of an estimated week.
- Result: 80% reduction in downtime and zero lost orders.
Comparing Update Methods
The built-in update method is 3 times faster than manual update, reducing downtime from 4 hours to 1 hour.
| Criteria | Built-in (OC 3.0.3+) | Manual |
|---|---|---|
| Ease | Yes, 2 clicks | Requires SSH access |
| Configuration | Does not overwrite config.php | Need to set exclusions |
| OCMOD | Automatic refresh | Manual Refresh in admin |
| DB migration | Built-in script | cli_install.php upgrade |
Manual update gives more control, but built-in is faster. For standard configurations, use the built-in mechanism.
Built-in Update: Admin → Extensions → Installer → Updates tab. Manual Update:
# Download new version wget https://github.com/opencart/opencart/releases/download/4.x.x/opencart-4.x.x.zip unzip opencart-4.x.x.zip # Copy only core files (preserve config.php and modifications) rsync -avz --exclude='config.php' \ --exclude='admin/config.php' \ --exclude='image/' \ --exclude='system/storage/upload/' \ opencart-4.x.x/upload/ \ /var/www/shop.com/ # Run database migration php /var/www/shop.com/install/cli_install.php upgrade How to Update Modules and OCMOD
OCMOD lets you install modifications without altering core files. After a core update, reapply modifications: Admin → Extensions → Modifications → Refresh. Modifications are stored separately—they are not overwritten.
Updating paid extensions: Admin → Extensions → Marketplace → Install, or manually via OpenCart Extension Installer (Upload .zip). After installation, refresh modifications and clear cache. A common issue: paid modules are often tied to a specific core version. Before updating the core, check each module's compatibility on the developer's site. If a module is not updated, contact us—it may need code adaptation.
Migration from OC3 to OC4
No direct upgrade exists—the database structure changed significantly. We recommend:
- Install OpenCart 4 on a new server.
- Migrate content (products, categories, orders) via export/import.
- Find OC4-compatible versions of all extensions.
- Transfer custom templates (OC4 uses Twig instead of PHP templates).
-- Export products from OC3 SELECT p.product_id, pd.name, p.model, p.sku, p.price, p.quantity, p.status FROM oc_product p JOIN oc_product_description pd ON p.product_id = pd.product_id AND pd.language_id = 1 INTO OUTFILE '/tmp/products_export.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n'; | Parameter | OpenCart 3 | OpenCart 4 |
|---|---|---|
| Templates | PHP | Twig |
| API | Legacy | RESTful API |
| PHP support | up to 7.4 | 8.0+ |
| Performance | Moderate | Higher due to caching |
What to Do If a Module Stops Working After Update
Module conflict resolution details
Check module compatibility: open its page on Marketplace or contact the developer. If it's a paid module, request a paid module update from the developer. Temporarily disable the module in admin (Extensions → Extensions → select type and click Disable). If the issue is in OCMOD, edit the modification file manually or remove it via Modifications. Don't forget to clear cache.Testing and Error Resolution
Post-update testing is crucial. After the update, run:
# PHP errors tail -f /var/log/php/error.log # Clear all caches rm -rf /var/www/shop.com/system/storage/cache/* After clearing cache, test cart, checkout, and payment gateway. If something went wrong, restore from backup.
What's Included in Our Service
We provide a full-service update package:
- Full backup of files and database
- Compatibility check of all installed modules and extensions
- Core update with OCMOD preservation
- Testing of checkout, payments, and logistics
- Conflict resolution (if any)
- Change documentation and consultation for ongoing support
- 30-day warranty on correct operation after update
Timeline and Cost
Update within the same major version: 2 to 4 hours. Migration from OC3 to OC4: from 2 weeks, including data transfer and template adaptation. Price is calculated individually based on the number of modules and customizations. Contact us for an engineer consultation and a project estimate.







