How to Downgrade Magento from Commerce to Open Source Using Opengento's Tool

Magento Commerce (EE) offers powerful features, but for many teams, Open Source (CE) is leaner, lighter, and more sustainable. If you're migrating from EE to CE, the Opengento downgrade tool provides a clean, scriptable way to remove proprietary modules and reset your codebase.
Here’s how to use it safely and effectively.
🧰 Prerequisites
Magento 2 Commerce installed (any version ≥ 2.3)
Composer installed and configured
Git version control (strongly recommended)
Full backup of your codebase and database
🚀 Step-by-Step Downgrade
1. Clone the downgrade tool
bash
git clone https://github.com/opengento/magento2-downgrade-ee-ce.git
cd magento2-downgrade-ee-ce
2. Copy the sample script
bash
cp downgrade.sample downgrade.sh
chmod +x downgrade.sh
3. Update downgrade.sh
Edit the script to include SQL cleanup after the downgrade logic. Example addition at the end:
bash
# Apply SQL cleanup patches
mysql magento_db < ./scripts/attributes.sql
mysql magento_db < ./scripts/ee.sql
mysql magento_db < ./scripts/cms.sql
mysql magento_db < ./scripts/catalogrule.sql
mysql magento_db < ./scripts/salesrule.sql
mysql magento_db < ./scripts/category.sql
mysql magento_db < ./scripts/product.sql
mysql magento_db < ./scripts/cataloginventory.sql
mysql magento_db < ./scripts/customer.sql
mysql magento_db < ./scripts/quote.sql
mysql magento_db < ./scripts/sales.sql
mysql magento_db < ./scripts/wishlist.sql
Replace magento_db with your actual database name.
4. Run the script
bash
./downgrade.sh
This will:
Remove EE modules
Rewrite
composer.jsonApply SQL cleanup patches
✅ Final Steps
bash
composer install
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush



