OpenCart Core and Modules Update
OpenCart uses modular architecture — core and extensions update differently. Core updates manually or via built-in mechanism, modules — via OpenCart Extension Installer.
Preparation for Update
# Backup files
tar czf /backups/opencart-$(date +%Y%m%d).tar.gz /var/www/shop.com
# Backup DB
mysqldump -u root opencart_db > /backups/opencart-db-$(date +%Y%m%d).sql
Update OpenCart Core
Via built-in mechanism (OpenCart 3.0.3+): Admin → Extensions → Installer → Updates tab.
Manually:
# 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 (NOT overwriting 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 DB migration
php /var/www/shop.com/install/cli_install.php upgrade
Update via OpenCart Modification System (OCMOD)
OCMOD allows installing modifications without changing core files. On core update modifications reapply:
Admin → Extensions → Modifications → Refresh
Modifications stored separately — not overwritten on core update.
Update Paid Extensions
Admin → Extensions → Marketplace → Install
# Or manually via Extension Installer:
Admin → Extensions → Installer → Upload
# Select extension .zip file
After extension install:
Admin → Extensions → Modifications → Refresh (apply OCMOD)
Admin → Dashboard → clear cache
OpenCart 3 → OpenCart 4 Update
No direct upgrade — DB structure changed significantly. Recommended path:
- Install OpenCart 4 on new server
- Migrate content (products, categories, orders) via export/import
- Find OC4-compatible versions of all extensions
- Migrate 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';
Check After Update
# PHP errors
tail -f /var/log/php/error.log
# Test cart and checkout
# Test payment gateway
# Clear all caches
# Admin → Dashboard → refresh icon
# Delete system/storage/cache/ if needed
rm -rf /var/www/shop.com/system/storage/cache/*
Timeframes
OpenCart update within one major version — 2–4 hours. OC3 to OC4 transition — 2–4 weeks.







