將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