Magento 2.4.9 Upgrade Walkthrough with Composer
Here is the practical sequence we follow to take a Magento Open Source store to 2.4.9. Do every step on staging before production.
1. Confirm the stack
2.4.9 expects PHP 8.4 or 8.5 and newer database, OpenSearch and Composer versions. Check what staging is running:
php -v composer --version mysql --version curl -s localhost:9200 | grep number
2. Back up code and data
php bin/magento maintenance:enable mysqldump --single-transaction --quick -u USER -p DBNAME | gzip > backup-$(date +%F).sql.gz tar -czf code-$(date +%F).tar.gz --exclude=var --exclude=generated --exclude=pub/static .
3. Change the Composer requirement
The official plugin updates composer.json in step with the new metapackage:
composer require-commerce magento/product-community-edition 2.4.9 --no-update composer update --with-all-dependencies
Conflicts nearly always come from third-party modules. Update each to a 2.4.9-ready release, or remove it temporarily, then try again.
4. Run the upgrade
rm -rf generated/code/* var/cache/* var/page_cache/* var/view_preprocessed/* php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy -f en_US en_GB php bin/magento indexer:reindex php bin/magento cache:flush
5. Find PHP compatibility issues
Static analysis spots implicitly nullable parameters, dynamic properties and removed functions in custom code:
vendor/bin/phpstan analyse app/code --level=5 vendor/bin/rector process app/code --dry-run
6. Test the paths that earn money
- Search, filters and product pages
- Cart, coupons, shipping and tax
- Every payment method, plus refunds
- Login, registration and password reset
- Cron, queues, imports and integrations
7. Go live
Repeat the steps on production in a planned window, then:
php bin/magento maintenance:disable php bin/magento cron:run
Keep the backups for at least two weeks after launch.
Need a second pair of eyes on this? Our team handles Magento development every week. See how we can help.