`
kirenenko04
  • 浏览: 145971 次
  • 性别: Icon_minigender_2
  • 来自: 上海
社区版块
存档分类
最新评论

Downgrading Magento Enterprise to Community

 
阅读更多

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.

分享到:
评论

相关推荐

    MySQL V5.5帮助文档

    1.6.4. MySQL Enterprise 1.7. How to Report Bugs or Problems 1.8. MySQL Standards Compliance 1.8.1. What Standards MySQL Follows 1.8.2. Selecting SQL Modes 1.8.3. Running MySQL in ANSI Mode 1.8.4. ...

    OpenStack Virtual Machine Image Guide

    Configuring the Glance servers to use Keystone Configuring Glance API to use Keystone Configuring Glance Registry to use Keystone The Glance Image Cache Managing the Glance Image Cache Configuration ...

    xplite_trial

    your regular Windows 2000 CDROM as this may result in downgrading of system files on your computer and potentially the re-introduction of bugs that were fixed by Microsoft in the Service Packs. If ...

    ethminer-0.16.0.dev3

    For Maxwell 2 GPUs: There is a way of mining ETH at Win7/8/Linux speeds on Win10, by downgrading the GPU driver to a Win7 one (350.12 recommended) and using a build that was created using CUDA 6.5. ...

    openwrt usb打印服务程序luci-app-usb-printer

    OPENWRT18.06网络打印机,usb打印服务安装,最新版本18.06.1软件源里只有luci-app-p910nd打印程序,不能很好兼容老打印机,没有luci-app-usb-printer.安装后,几台打印机全罢工,玩完了。只能重刷回旧版本。...

    Hacking the PSP

    Chapter 16: Downgrading Your PSP’s Firmware and Other Firmware Hacks Chapter 17: Programming the PSP: Setting Up the Development Environment Chapter 18: Programming the PSP: Hello World Chapter 19...

    MySQL 5.6 Reference Manual

    Table of Contents Preface, Notes, Licenses . . . . . . . . ....1. Licenses for Third-Party Components ....1.1. FindGTest.cmake License ....1.2. LPeg Library License ....1.3. LuaFileSystem Library License ....

    MySQL中文参考手册

    o 4.16 升级和降级(downgrading)时有什么特别要做的事情吗? + 4.16.1 从一个 3.22 版本升级到 3.23 + 4.16.2 从一个 3.21 版本升级到 3.22 + 4.16.3 从一个 3.20 版本升级到 3.21 + 4.16.4 升级到其他的...

    MYSQL

    4.16 升级和降级(downgrading)时有什么特别要做的事情吗? 4.16.1 从一个 3.22 版本升级到 3.23 4.16.2 从一个 3.21 版本升级到 3.22 4.16.3 从一个 3.20 版本升级到 3.21 4.16.4 升级到其他的...

    MySQL中文参考手册.chm

    MySQL 4.15.4 选项文件 4.16 升级和降级(downgrading)时有什么特别要做的事情吗? 4.16.1 从一个 3.22 版本升级到 3.23 4.16.2 从一个 3.21 版本升级到 3.22 4.16.3 从一个 3.20 版本升级到...

Global site tag (gtag.js) - Google Analytics