Downgrading Magento Enterprise to Community

本文提供了一步一步的指导方案,帮助用户将其Magento企业版商店安全地降级到社区版,包括删除企业文件、修复登录问题、清除企业属性等关键步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Magento Enterprise comes with a bunch of nice features that are not included in the free community edition, like RMA, store credits, gift registry, cart reminders and more. But sometimes those features aren’t enough upside to justify the huge price tag (> 10.000 € every year) one has to pay. Therefore some store owners decide to downgrade their existing Magento setup to the free version and replace enterprise features with third party extensions.

But this is only the first half of the battle. You can’t just remove a bunch of enterprise files and you’re all set. Since we did downgrade shops before, we figured a compact guide on how to do it right, might be helpful, so here you go. But be aware: back up your database and use a new branch in your version control system before starting this process, it’s not trivial – things might go sideways!

Deleting enterprise files

The first step is still to actually remove all enterprise related files, in a normal setup you can do it like this:

rm -rf app/code/core/Enterprise
rm -rf downloader/template/enterprise
rm -rf app/design/install/default/enterprise
rm -rf app/design/frontend/enterprise
rm -rf app/design/adminhtml/default/default/layout/enterprise
rm -rf app/design/adminhtml/default/default/template/enterprise
rm -f app/locale/en_US/Enterprise_*.xml
rm -rf skin/adminhtml/default/enterprise
rm -rf skin/frontend/enterprise
rm -rf skin/install/default/enterprise
rm -f app/etc/modules/Enterprise_*.xml
rm -f app/etc/enterprise.xml
rm -rf app/locale/en_US/template/email/enterprise/
rm -rf js/enterprise
rm -rf errors/enterprise
rm -f LICENSE_EE.txt
rm -f LICENSE_EE.html

 After that, it’s a good idea to replace the whole app/code/core/Mage  folder with the version from the community edition. Go and download the archive and replace the files, but make sure you use the community edition version that your enterprise version was built upon. The reason for replacing the folder is that the enterprise version actually has changes in this folder, so you will probably run into problems if you don’t do that (even though the shop might seem to work at a first glance). This – of course – will remove all core hacks. You don’t have any, do you?

Fixing login

Once you finished the file part, click through the shop. In recent versions of Magento, you’ll quickly notice that you can’t log in, both in the frontend as a customer and in the backend as administrator. Stay calm, your database is still good! The enterprise version of Magento comes with a different hashing mechanism for passwords, so when you removed the enterprise files, Magento used the next best version, which is the community one. But since the hash algorithm is different, the login fails. This is actually a pretty easy fix, if you know the problem.

Take a look at the file  app/code/core/Enterprise/Pci/Model/Encryption.php . It contains the algorithm used by the enterprise version. So all you have to do is to create your own model and replicate the behavior. After that, tell Magento about the rewrite:

<helpers>
   <core>
       <encryption_model>Module_Namespace_Model_Encryption</encryption_model>
   </core>
</helpers>

 With that in place both frontend and backend login should work as before, no need to change passwords or anything.

Deleting enterprise attributes

Since it’s possible now, let’s log in into the backend to check if everything is working as expected. Click around. Create a new product. Oh snap. Not working. The reason for this is that you still have enterprise attributes linked in your database, which will be automatically loaded by Magento when you create a new product. But the according source files aren’t present anymore so the request fails. Again, an easy fix – remove the unnecessary attribtues:

DELETE FROM eav_attribute WHERE source_model LIKE 'enterprise_%';
DELETE FROM eav_attribute WHERE backend_model LIKE 'enterprise_%';
DELETE FROM eav_attribute WHERE attribute_code IN ('gift_wrapping_available', 'gift_wrapping_price');

 Note: Make sure you don’t need the related data anymore before you do this!

Fixing URL index

Next up is the URL index. Try to re-index, it will fail (if you ran 1.13.x). Why’s that? Well, Magento uses different database tables for url rewrites in the enterprise edition, actually the whole database layout is completely different. And you removed the files necessary to fill those tables. So go ahead and tell Magento that you want to use the standard table layout instead:

UPDATE eav_attribute SET backend_table = NULL WHERE attribute_code = 'url_key';

 

While this will make your re-indexing process work again, you might find that most of your URLs changed, especially the ones from product detail pages. Depending on how you used URL keys with your old installation, this can effect any number of URLs, from none to all. In order to use the URL keys from the enterprise setup, clear the rewrite table, retrieve necessary IDs and copy the URL keys over:

delete from core_url_rewrite where is_system != 0;
 
SELECT @entity_type_id:=entity_type_id FROM eav_entity_type WHERE entity_type_code = 'catalog_product';
SELECT @attribute_id:=attribute_id FROM eav_attribute WHERE attribute_code = 'url_key' AND entity_type_id = @entity_type_id;
 
UPDATE catalog_product_entity_varchar new
INNER JOIN catalog_product_entity_url_key old
ON (new.attribute_id = @attribute_id AND new.entity_type_id = @entity_type_id AND old.entity_id = new.entity_id)
SET new.value = old.value;

 Make sure to re-index everything in Magento’s backend afterwards!

Fixing templates

From a functional point of few, this should be it. Your shop should work as before now, but without the ability to use enterprise features. If that’s not the case, you probably have references to enterprise blocks in your layout xml files. You can find them like so:

grep -rn '"enterprise_' app/design/$your_design

 Remove the references and the exceptions should go away. However, depending on the way your layout was implemented, your shop might look a bit strange. This is completely shop-related and can’t be explained in this tutorial. But as a rule of thumb, look at the code from the (removed) enterprise template (layout xmls and templates), see how it effects the style of your shop and go from there. Same goes for CSS and JavaScript files.

Checking third party extensions

Walk through all the third party extensions you might have installed, both in the local and community folder and check if any of them is extending enterprise-only behavior. Clearly those won’t work anymore or even bring the shop down. Again, this is completely specific to the shop and the extensions, so we can’t give you real advice. But make sure you check all extensions, before you go live with the downgrade.

Wrap up

With the steps mentioned above, you will have a working community edition, based on your former enterprise version. We recommend to not delete any enterprise related tables (most start with enterprise_*) until the process is completely finished and live. Even then, only delete them if you feel confident and test it excessively on your local setup before doing it live!

You could also start a fresh Magento community setup and migrate the existing data over. Since Magento has multiple hundreds of tables, we don’t like this approach, due to the high risk of corrupted or missing data. We also feel like the downgrade would be even more error prone and would take longer this way.

We hope this helps, let’s us know if you need further guidance.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值