将Magento2从企业版迁移/降级到社区版

Magento 2企业版(EE)是Magento 2社区版(CE)的付费版本。如果您是一家渴望成长并期望巨大网站流量的企业,那么EE是您公司的最佳解决方案。此外,企业版完全由Magento团队支持。订户通过电话和电子邮件获得全面支持。许可证定价还包括安全更新,特殊功能和独家产品增强功能。但是,这一切都取决于公司的收入,每年的价格高达25,000美元或以上。
 
P / S:请注意,Magento已将其重命名为Magento 2产品
 
Magento企业版(EE)现在称为Magento Commerce
Magento社区版(CE)现在称为Magento开源
为什么从企业降级为社区?
简短的答案是:除非您真的不需要,否则实际上不需要。
 
没有人喜欢降级任何东西。但有时由于某些限制您不得不这样做。认为许可证费用昂贵并且迟早不利用任何企业功能的商人可能会考虑改用社区版本。
 
在本文中,我将总结如何成功地从Magento企业版(EE)迁移/降级到社区版(CE)。
 
如何从EE降级/迁移到CE?
为了简洁起见,不考虑迁移自定义主题和模块。
1.从master创建一个新分支
git fetch --all
git checkout master
git pull origin master
git checkout -b feature/magento2ce-downgrade
2.更新composer.json
更新的元包引用magento/product-enterprise-edition到magento/project-community-edition。
另外,您可以手动添加/删除其他必需的软件包。
尝试使用确切的版本,而不是使用  *,  ~,  < 和  > 运营商。
 
在我们的例子中,composer.json文件看起来像
{
     "name": "magento/project-community-edition",
     "description": "eCommerce Platform for Growth (Community Edition)",
     "type": "project",
     "version": "2.1.1",
     "license": [
         "OSL-3.0",
         "AFL-3.0"
     ],
     "require": {
         "magento/product-community-edition": "2.1.1",
         "composer/composer": "@alpha",
         // … third party packages goes here
     },
     "require-dev": {
         "phpunit/phpunit": "4.1.0",
         "squizlabs/php_codesniffer": "1.5.3",
         "phpmd/phpmd": "@stable",
         "pdepend/pdepend": "2.2.2",
         "fabpot/php-cs-fixer": "~1.2",
         "lusitanian/oauth": "~0.3 <=0.7.0",
         "sebastian/phpcpd": "2.0.0"
     },
     "config": {
         "use-include-path": true
     },
     "autoload": {
         "psr-4": {
             "Magento\Framework\": "lib/internal/Magento/Framework/",
             "Magento\Setup\": "setup/src/Magento/Setup/",
             "Magento\": "app/code/Magento/"
         },
         "psr-0": {
             "": "app/code/"
         },
         "files": [
             "app/etc/NonComposerComponentRegistration.php"
         ]
     },
     "autoload-dev": {
         "psr-4": {
             "Magento\Sniffs\": "dev/tests/static/framework/Magento/Sniffs/",
             "Magento\Tools\": "dev/tools/Magento/Tools/",
             "Magento\Tools\Sanity\": "dev/build/publication/sanity/Magento/Tools/Sanity/",
             "Magento\TestFramework\Inspection\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
             "Magento\TestFramework\Utility\": "dev/tests/static/framework/Magento/TestFramework/Utility/"
         }
     },
     "minimum-stability": "alpha",
     "prefer-stable": true,
     "repositories": [
         {
             "type": "composer",
             "url": "https://repo.magento.com/"
         }
     ],
     "extra": {
         "magento-force": "override"
     }
 }
3,删除与EE相关的许可证文件(不是必需的)

cd /path/to/magento2/root/
rm -f./LICENSE_EE.txt
检查并删除是否还有剩余的EE模块
find . -name LICENSE_EE.txt
编辑 –无需手动删除EE许可证文件,因为该composer update操作将自动删除它们。
 
4.禁用EE模块
在中手动禁用所有EE模块  app/etc/config.php。将来,我们将共享config.php生成器,以使手动过程变得更加轻松和快捷。
 
在撰写本文时,可用的EE模块是
module-amqp
module-banner
module-banner-customer-segment
module-bundle-staging
module-catalog-event
module-catalog-import-export-staging
module-catalog-inventory-staging
module-catalog-permissions
module-catalog-rule-staging
module-catalog-staging
module-catalog-url-rewrite-staging
module-checkout-staging
module-cms-staging
module-configurable-product-staging
module-custom-attribute-management
module-customer-balance
module-customer-custom-attributes
module-customer-finance
module-customer-segment
module-cybersource
module-downloadable-staging
module-elasticsearch
module-enterprise
module-eway
module-gift-card
module-gift-card-account
module-gift-card-import-export
module-gift-card-staging
module-gift-message-staging
module-gift-registry
module-gift-wrapping
module-gift-wrapping-staging
module-google-optimizer-staging
module-google-tag-manager
module-grouped-product-staging
module-invitation
module-layered-navigation-staging
module-logging
module-message-queue
module-msrp-staging
module-multiple-wishlist
module-mysql-mq
module-payment-staging
module-persistent-history
module-price-permissions
module-product-video-staging
module-promotion-permissions
module-reminder
module-resource-connections
module-review-staging
module-reward
module-rma
module-rma-staging
module-sales-archive
module-sales-rule-staging
module-scalable-checkout
module-scalable-inventory
module-scalable-oms
module-scheduled-import-export
module-search-staging
module-solr
module-staging
module-support
module-target-rule
module-versions-cms
module-visual-merchandiser
module-website-restriction
module-weee-staging
module-worldpay

5. 更新升级 composer
composer update
此过程可能需要一些时间。
这将删除所有EE软件包并安装CE软件包。
示例输出看起来像
Loading composer repositories with package information
 Updating dependencies (including require-dev)
 Package operations: 1 install, 52 updates, 85 removals
 Removing magento/product-enterprise-edition (2.1.1)
 Removing Magento/ProductEnterpriseEdition
 Removing magento/magento2-ee-base (2.1.1)
 Removing Magento/Magento2EeBase
 Removing magento/module-amqp (100.1.0)
 Removing Magento/Amqp
 Removing php-amqplib/php-amqplib (v2.5.2)
 Removing Php-amqplib/PhpAmqplib
 Removing magento/module-worldpay (100.1.0)
 Removing Magento/Worldpay
 Removing magento/module-catalog-url-rewrite-staging (100.1.0)
 Removing Magento/CatalogUrlRewriteStaging
 Removing magento/module-bundle-staging (100.1.0)
 Removing Magento/BundleStaging
 Removing magento/module-checkout-staging (100.1.0)
 Removing Magento/CheckoutStaging
 Removing magento/module-cms-staging (100.1.1)
 Removing Magento/CmsStaging
 Removing magento/module-configurable-product-staging (100.1.0)
 Removing Magento/ConfigurableProductStaging
 Removing magento/module-downloadable-staging (100.1.0)
 Removing Magento/DownloadableStaging
 Removing magento/module-grouped-product-staging (100.1.0)
 Removing Magento/GroupedProductStaging
 Removing magento/module-payment-staging (100.1.0)
 Removing Magento/PaymentStaging
 Removing magento/module-support (100.1.0)
 Removing Magento/Support
 Removing magento/module-solr (100.1.0)
 Removing Magento/Solr
 Removing solarium/solarium (3.3.0)
 Removing Solarium/Solarium
 Removing magento/module-message-queue (100.1.0)
 Removing Magento/MessageQueue
 Removing magento/module-mysql-mq (100.1.0)
 Removing Magento/MysqlMq
 Removing magento/module-eway (100.1.0)
 Removing Magento/Eway
 Removing magento/module-google-tag-manager (100.1.0)
 Removing Magento/GoogleTagManager
 Removing magento/module-admin-gws (100.1.0)
 Removing Magento/AdminGws
 Removing magento/module-banner-customer-segment (100.1.0)
 Removing Magento/BannerCustomerSegment
 Removing magento/module-catalog-import-export-staging (100.1.0)
 Removing Magento/CatalogImportExportStaging
 Removing magento/module-customer-finance (100.1.0)
 Removing Magento/CustomerFinance
 Removing magento/module-enterprise (100.1.0)
 Removing Magento/Enterprise
 Removing magento/module-catalog-event (100.1.0)
 Removing Magento/CatalogEvent
 Removing magento/module-catalog-permissions (100.1.0)
 Removing Magento/CatalogPermissions
 Removing magento/module-gift-card-staging (100.1.0)
 Removing Magento/GiftCardStaging
 Removing magento/module-gift-card-account (100.1.0)
 Removing Magento/GiftCardAccount
 Removing magento/module-customer-balance (100.1.0)
 Removing Magento/CustomerBalance
 Removing magento/module-gift-card-import-export (100.1.0)
 Removing Magento/GiftCardImportExport
 Removing magento/module-gift-registry (100.1.0)
 Removing Magento/GiftRegistry
 Removing magento/module-gift-wrapping (100.1.0)
 Removing Magento/GiftWrapping
 Removing magento/module-logging (100.1.0)
 Removing Magento/Logging
 Removing magento/module-multiple-wishlist (100.1.0)
 Removing Magento/MultipleWishlist
 Removing magento/module-advanced-checkout (100.1.1)
 Removing Magento/AdvancedCheckout
 Removing magento/module-cybersource (100.1.0)
 Removing Magento/Cybersource
 Removing magento/module-persistent-history (100.1.0)
 Removing Magento/PersistentHistory
 Removing magento/module-price-permissions (100.1.0)
 Removing Magento/PricePermissions
 Removing magento/module-gift-card (101.0.1)
 Removing Magento/GiftCard
 Removing magento/module-promotion-permissions (100.1.0)
 Removing Magento/PromotionPermissions
 Removing magento/module-banner (100.1.0)
 Removing Magento/Banner
 Removing magento/module-reminder (100.1.0)
 Removing Magento/Reminder
 Removing magento/module-reward (100.1.0)
 Removing Magento/Reward
 Removing magento/module-invitation (100.1.0)
 Removing Magento/Invitation
 Removing magento/module-rma (100.1.0)
 Removing Magento/Rma
 Removing magento/module-customer-custom-attributes (100.1.0)
 Removing Magento/CustomerCustomAttributes
 Removing magento/module-custom-attribute-management (100.1.0)
 Removing Magento/CustomAttributeManagement
 Removing magento/module-sales-archive (100.1.0)
 Removing Magento/SalesArchive
 Removing magento/module-advanced-catalog (100.1.0)
 Removing Magento/AdvancedCatalog
 Removing magento/module-advanced-sales-rule (100.1.0)
 Removing Magento/AdvancedSalesRule
 Removing magento/module-scalable-checkout (100.1.0)
 Removing Magento/ScalableCheckout
 Removing magento/module-scalable-inventory (100.1.0)
 Removing Magento/ScalableInventory
 Removing magento/module-scalable-oms (100.1.0)
 Removing Magento/ScalableOms
 Removing magento/module-scheduled-import-export (100.1.0)
 Removing Magento/ScheduledImportExport
 Removing magento/module-target-rule (100.1.1)
 Removing Magento/TargetRule
 Removing magento/module-customer-segment (100.1.0)
 Removing Magento/CustomerSegment
 Removing magento/module-advanced-rule (100.1.0)
 Removing Magento/AdvancedRule
 Removing magento/module-versions-cms (100.1.0)
 Removing Magento/VersionsCms
 Removing magento/module-visual-merchandiser (100.1.0)
 Removing Magento/VisualMerchandiser
 Removing magento/module-website-restriction (100.1.0)
 Removing Magento/WebsiteRestriction
 Removing magento/module-resource-connections (100.1.0)
 Removing Magento/ResourceConnections
 Removing magento/module-elasticsearch (100.1.0)
 Removing Magento/Elasticsearch
 Removing magento/module-advanced-search (100.1.0)
 Removing Magento/AdvancedSearch
 Removing elasticsearch/elasticsearch (v2.3.0)
 Removing Elasticsearch/Elasticsearch
 Removing guzzlehttp/ringphp (1.1.0)
 Removing Guzzlehttp/Ringphp
 Removing guzzlehttp/streams (3.0.0)
 Removing Guzzlehttp/Streams
 Removing react/promise (v2.5.0)
 Removing React/Promise
 Removing magento/module-catalog-rule-staging (100.1.1)
 Removing Magento/CatalogRuleStaging
 Removing magento/module-sales-rule-staging (100.1.1)
 Removing Magento/SalesRuleStaging
 Removing magento/module-search-staging (100.1.0)
 Removing Magento/SearchStaging
 Removing magento/module-layered-navigation-staging (100.1.0)
 Removing Magento/LayeredNavigationStaging
 Removing magento/module-catalog-inventory-staging (100.1.0)
 Removing Magento/CatalogInventoryStaging
 Removing magento/module-gift-message-staging (100.1.0)
 Removing Magento/GiftMessageStaging
 Removing magento/module-gift-wrapping-staging (100.1.0)
 Removing Magento/GiftWrappingStaging
 Removing magento/module-google-optimizer-staging (100.1.0)
 Removing Magento/GoogleOptimizerStaging
 Removing magento/module-msrp-staging (100.1.0)
 Removing Magento/MsrpStaging
 Removing magento/module-review-staging (100.1.0)
 Removing Magento/ReviewStaging
 Removing magento/module-rma-staging (100.1.0)
 Removing magento/module-weee-staging (100.1.0)
 Removing Magento/RmaStaging
 Removing Magento/WeeeStaging
 Removing magento/module-product-video-staging (100.1.0)
 Removing Magento/ProductVideoStaging
 Removing magento/module-catalog-staging (100.1.1)
 Removing Magento/CatalogStaging
 Removing magento/module-staging (100.1.1)
 Removing Magento/Staging
 Removing magento/framework-message-queue (100.1.0)
 Removing Magento/FrameworkMessageQueue
 Removing magento/framework-foreign-key (100.1.0)
 Removing Magento/FrameworkForeignKey
 Updating magento/magento-composer-installer (0.1.12 => 0.1.13): Loading from cache
 Updating oyejorge/less.php (v1.7.0.10 => v1.7.0.14): Loading from cache
 Updating phpseclib/phpseclib (2.0.4 => 2.0.17): Downloading (100%)
 Updating zendframework/zend-stdlib (2.4.11 => 2.4.13): Loading from cache
 Updating zendframework/zend-eventmanager (2.4.11 => 2.4.13): Loading from cache
 Updating zendframework/zend-code (2.4.11 => 2.4.13): Loading from cache
 Updating zendframework/zend-di (2.4.11 => 2.4.13): Loading from cache
 Updating zendframework/zend-modulemanager (2.4.11 => 2.4.13): Loading from cache
 Updating zendframework/zend-loader (2.4.11 => 2.4.13): Loading from cache
 Updating zendframework/zend-view (2.4.11 => 2.4.13): Loading from cache
 Updating zendframework/zend-validator (2.4.11 => 2.4.13): Loading from cache
 Updating zendframework/zend-escaper (2.4.11 => 2.4.13): Loading from cache
 Updating zendframework/zend-uri (2.4.11 => 2.4.13): Loading from cache
 Updating zendframework/zend-server (2.4.11 => 2.4.13): Loading from cache
 Updating zendframework/zend-soap (2.4.11 => 2.4.13): Loading from cache
 Updating zendframework/zend-console (2.4.11 => 2.4.13): Loading from cache
 Updating zendframework/zend-servicemanager (2.4.11 => 2.4.13): Loading from cache
 Updating zendframework/zend-text (2.4.11 => 2.4.13): Loading from cache
 Updating zendframework/zend-i18n (2.4.11 => 2.4.13): Loading from cache
 Updating zendframework/zend-config (2.4.11 => 2.4.13): Loading from cache
 Updating zendframework/zend-math (2.4.11 => 2.4.13): Loading from cache
 Updating zendframework/zend-json (2.4.11 => 2.4.13): Loading from cache
 Updating zendframework/zend-serializer (2.4.11 => 2.4.13): Loading from cache
 Updating zendframework/zend-log (2.4.11 => 2.4.13): Loading from cache
 Updating zendframework/zend-crypt (2.4.11 => 2.4.13): Loading from cache
 Updating zendframework/zend-http (2.4.11 => 2.4.13): Loading from cache
 Updating zendframework/zend-filter (2.4.11 => 2.4.13): Loading from cache
 Updating zendframework/zend-inputfilter (2.4.11 => 2.4.13): Loading from cache
 Updating zendframework/zend-form (2.4.11 => 2.4.13): Loading from cache
 Updating zendframework/zend-mvc (2.4.11 => 2.4.13): Loading from cache
 Updating mongodb/mongodb (1.1.1 => 1.4.2): Downloading (100%)
 Updating psr/log (1.0.2 => 1.1.0): Loading from cache
 Updating phpunit/php-timer (1.0.8 => 1.0.9): Loading from cache
 Installing symfony/polyfill-ctype (v1.11.0): Loading from cache
 Updating symfony/yaml (v2.8.17 => v2.8.50): Loading from cache
 Updating symfony/filesystem (v2.8.17 => v2.8.50): Loading from cache
 Updating symfony/config (v2.8.17 => v2.8.50): Loading from cache
 Updating symfony/dependency-injection (v2.8.17 => v2.8.50): Loading from cache
 Updating algolia/algoliasearch-client-php (1.18.0 => 1.28.0): Downloading (100%)
 Updating sebastian/diff (1.4.1 => 1.4.3): Loading from cache
 Updating symfony/stopwatch (v3.2.3 => v3.4.28): Loading from cache
 Updating symfony/process (v2.8.17 => v2.8.50): Loading from cache
 Updating symfony/finder (v3.2.3 => v3.4.28): Downloading (100%)
 Updating symfony/event-dispatcher (v2.8.17 => v2.8.50): Loading from cache
 Updating fabpot/php-cs-fixer (v1.13.1 => v1.13.3): Loading from cache
 Updating composer/semver (1.4.2 => 1.5.0): Loading from cache
 Updating composer/spdx-licenses (1.1.5 => 1.5.1): Loading from cache
 Updating seld/cli-prompt (1.0.2 => 1.0.3): Loading from cache
 Updating seld/jsonlint (1.5.0 => 1.7.1): Loading from cache
 Updating sebastian/recursion-context (1.0.2 => 1.0.5): Loading from cache
 Updating phpunit/php-token-stream (1.4.9 => 1.4.12): Loading from cache
 Updating theseer/fdomdocument (1.6.1 => 1.6.6): Loading from cache
 Updating sebastian/finder-facade (1.2.1 => 1.2.2): Loading from cache
 Package sjparkinson/static-review is abandoned, you should avoid using it. Use phpro/grumphp instead.
 Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
 Package fabpot/php-cs-fixer is abandoned, you should avoid using it. Use friendsofphp/php-cs-fixer instead.
 Writing lock file
 Generating autoload files
6. DB数据库清理
setup_module例如,从表中删除EE模块的条目
DELETE FROM setup_module WHERE module IN (
	'Magento_Amqp', 'Magento_BundleStaging', 'Magento_CatalogEvent', 'Magento_CatalogImportExportStaging', 'Magento_CatalogInventoryStaging', 'Magento_CatalogPermissions', 'Magento_CatalogRuleStaging', 'Magento_CatalogStaging', 'Magento_CatalogUrlRewriteStaging', 'Magento_CheckoutStaging', 'Magento_CmsStaging', 'Magento_ConfigurableProductStaging', 'Magento_CustomerBalance', 'Magento_CustomerFinance', 'Magento_Cybersource', 'Magento_DownloadableStaging', 'Magento_Elasticsearch', 'Magento_Enterprise', 'Magento_Eway', 'Magento_GiftCardAccount', 'Magento_GiftCardImportExport', 'Magento_GiftCardStaging', 'Magento_GiftMessageStaging', 'Magento_GiftRegistry', 'Magento_GiftWrapping', 'Magento_GiftWrappingStaging', 'Magento_GoogleOptimizerStaging', 'Magento_GroupedProductStaging', 'Magento_Invitation', 'Magento_LayeredNavigationStaging', 'Magento_MessageQueue', 'Magento_MsrpStaging', 'Magento_MultipleWishlist', 'Magento_MysqlMq', 'Magento_PaymentStaging', 'Magento_PersistentHistory', 'Magento_PricePermissions', 'Magento_ProductVideoStaging', 'Magento_PromotionPermissions', 'Magento_Reminder', 'Magento_ResourceConnections', 'Magento_ReviewStaging', 'Magento_Reward', 'Magento_RmaStaging', 'Magento_SalesArchive', 'Magento_SalesRuleStaging', 'Magento_ScalableCheckout', 'Magento_ScalableInventory', 'Magento_ScalableOms', 'Magento_ScheduledImportExport', 'Magento_SearchStaging', 'Magento_Solr', 'Magento_Staging', 'Magento_Support', 'Magento_VersionsCms', 'Magento_WebsiteRestriction', 'Magento_WeeeStaging', 'Magento_Worldpay'
);
您还可以根据需要删除与EE模块相关的属性,字段和表。但是即使将它们保持原样,它也应该可以正常工作。

7.清除缓存

# Prior Magento 2.3
# rm -rf var/cache/ var/page_cache/ var/view_preprocessed/ var/generation/
# Magento 2.3+
rm -rf var/cache/ var/page_cache/ var/view_preprocessed/ generated/
8.验证Magento版本
使用以下方法,确保Magento版现在是纯社区版:
 
浏览  {magento-2-base-rl}/magento_version URL以检查版本。结果应该是 Magento/2.x (Community)
检查composer.json 文件是否指向存储  magento/project-community-edition 库。
检查是否没有EE许可证文件(LICENSE_EE.txt)。您可以使用以下命令find . -name LICENSE_EE.txt
检查路径中是否没有任何EE di.xml app/etc/enterprise/di.xml
检查是否没有与EE相关的模块(请参见上面的列表)
如果代码库验证了社区版本,请继续进行测试。
 
9.浏览网站并彻底检查
在开发人员模式下彻底检查网站(打开错误报告)。
如果一切运行正常,中提琴已成功将Magento版本降级为社区。
 
10.实时部署
如果一切正常,那么您可以创建一个发布标签并在LIVE中进行部署

# get latest code for master
git fetch --all
git checkout master
git pull origin master

# rebase the branch with master
git checkout feature/magento2ce-downgrade
git pull origin feature/magento2ce-downgrade
git rebase master
git push origin feature/magento2ce-downgrade --force

# create release tag
git tag -a v1.0.1 -m 'Downgrade to CE'
git push origin v1.0.1 --follow-tags
综上所述:
Magento 2企业版是预算较大且不想处理自定义和增强功能的大型商家的更好选择。我们强烈推荐Magento 2企业版给合适的客户。尽管我们强烈建议您使用企业版来体验先进的电子商务平台并扩展您的业务,但我们仍认为昂贵的许可费是某些商家的主要问题。

相关文章

  1. Magento2网站每天都宕机,需要重启服务器

    我在Magento 2.2.2中有一个电子商务网站,它几乎每天都在宕机死机。每当它发生故障时,用户得到的网站太长时间也会响应而且从未加载。为了让网站再次运行,我必须重新启动服务器然...

    2020-02-25
  2. 通过SQL在Magento中导入产品评论

    当客户看到具有好评的产品时,他们更有可能做出购买决定。 另外,一些搜索引擎为具有产品评论的网站提供了比没有评论的网站更高的排名。 由于Magento不支持导入产品评论的默认功...

    2020-04-23
  3. 如何在Magento2安装配置中文汉化包

    magento2版本与magento1相比较做中文汉化变化还是很大,今天最模板整理修正如下: 常用的安装方式有2种: 方法一:通过composer安装中文包; 安装中文包: composer require mageplaza/magento-2-chi...

    2020-04-23
  4. 将Magento2从企业版迁移/降级到社区版

    Magento 2企业版(EE)是Magento 2社区版(CE)的付费版本。如果您是一家渴望成长并期望巨大网站流量的企业,那么EE是您公司的最佳解决方案。此外,企业版完全由Magento团队支持。订户通...

    2020-04-24
  5. 解决Magento1发送邮件Email代码乱码办法

    我们在做magento1活动或者开发插件的时候 ,时常为了通知用户就是用系统的email发送,但是如果你发送的内容是是日语或者其他语言的时,出现了乱码,发送email代码如下。 private functi...

    2020-04-24
  6. 如何在magento2.3 nginx配置https

    现在有很多magento网站免费的https,基本上90%上线的网站都用了https。 但是很多朋友对magento里的nginx配置https不熟悉,现在我们就来整理下。 一,准备工作 你至少需要提供如下必须用品...

    2020-04-23