Upgrading Magento is not just running Composer commands — it involves server compatibility, database validation, extension checks, and search engine migration.
This is the most complete, technically accurate Magento 2.4.7 upgrade tutorial you can publish.
Before You Start – Critical Notes
Magento 2.4.7 requires:
- PHP 8.1 / 8.2
- OpenSearch 2.x
- Elasticsearch is deprecated
- Composer 2.x
- MariaDB 10.6+
- RabbitMQ optional but recommended
DO NOT upgrade directly on production.
ALWAYS use a staging environment.
1. Pre-Upgrade Checklist
Before upgrading Magento to 2.4.7, complete the following:
1.1 Check Server Compatibility
Run:
php -v
mysql -V
composer -V
Ensure:
- PHP 8.1 or 8.2 or 8.3
- MySQL/MariaDB supported
- Composer 2.x
- OpenSearch running
1.2 Enable Maintenance Mode (On Staging Only)
php bin/magento maintenance:enable
1.3 Backup Everything
php bin/magento setup:backup --code --media --db
OR manually backup:
/app,/vendor,/pub/mediaenv.php+config.php- Database dump
1.4 Check & Disable Third-Party Extensions
List modules:
php bin/magento module:status
Disable custom modules:
php bin/magento module:disable Vendor_ModuleName
1.5 Switch to Developer Mode
php bin/magento deploy:mode:set developer
2. Update Composer Configuration
Open your project root and run:
composer require magento/product-community-edition=2.4.7 --no-update
OR for Enterprise Edition:
composer require magento/product-enterprise-edition=2.4.7 --no-update
Then update PHP and package constraints:
composer update
If you face memory issues:
php -d memory_limit=-1 /usr/bin/composer update
3. Fix Dependencies & Conflicts (Most Common Step)
During a Magento upgrade, you may see:
- dependency conflicts
- PHP version mismatch
- extension constraints
- elasticsearch packages
Fix them by upgrading compatible packages:
composer require elasticsearch/elasticsearch:^7.17
composer require opensearch-project/opensearch-php:^2.0
If theme packages block the upgrade:
Update them manually in composer.json.
4. Run Magento Upgrade Commands
Once Composer update finishes:
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
Flush cache:
php bin/magento cache:flush
5. Migrate to OpenSearch (Mandatory for 2.4.7)
Magento 2.4.7 drops Elasticsearch support.
Step 5.1 Install OpenSearch (Server)
Ubuntu example:
sudo apt install opensearch
sudo systemctl enable opensearch
sudo systemctl start opensearch
Step 5.2 Configure Magento Search Engine
Update env.php:
'opensearch' => [
'hostname' => '127.0.0.1',
'port' => '9200'
]
OR via Admin after upgrade:
Stores → Configuration → Catalog → Catalog Search → Search Engine = OpenSearch
Reindex:
php bin/magento indexer:reindex
6. Reindex & Clear Logs
php bin/magento indexer:reindex
php bin/magento cache:flush
rm -rf var/log/*
7. Upgrade Database Schema
php bin/magento setup:upgrade
Check DB errors in:
var/log/system.log
var/log/exception.log
8. Re-Enable Extensions
php bin/magento module:enable Vendor_ModuleName
php bin/magento setup:upgrade
Make sure each module is compatible with 2.4.7.
9. Switch Back to Production Mode
php bin/magento deploy:mode:set production
Optional but recommended:
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush
10. Post-Upgrade Testing Checklist
10.1 Frontend Testing
- Homepage
- Category pages
- Product pages
- Search
- Cart
- Checkout
- Payment gateway
- Customer login/register
10.2 Admin Panel Testing
- Orders, invoices, credit memos
- Promotions
- Catalog product creation
- Shipping methods
- Admin grid filters
- Indexer status
10.3 API Testing
Test:
- REST
- GraphQL
- Webhooks
- ERP/CRM integrations
10.4 Logs & Cron
Check logs:
var/log/system.log
var/log/exception.log
Run crons:
php bin/magento cron:run
Optional: Downgrade/Restore if Something Breaks
Run:
php bin/magento setup:rollback --code --db --media
Or restore backup manually.
Frequently Asked Questions (FAQ)
1. How to upgrade Magento safely to 2.4.7?
Follow a strict process: backups → staging → composer update → upgrade commands → OpenSearch migration → QA.
2. What PHP version is required for Magento 2.4.7?
PHP 8.1 or 8.2.
3. Is Elasticsearch supported?
No — Magento 2.4.7 requires OpenSearch.
4. Will extensions break during upgrade?
If they’re outdated, yes. Always update or patch them.
5. How long does a Magento 2.4.7 upgrade take?
2–5 days for small stores, 7–14 days for complex setups.
