Search

Mar 29, 2023

Magento 2 composer commands

Install B2B module

composer require magento/extension-b2b
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f
bin/magento cache:clean

Install sample data M2.3

bin/magento sampledata:deploy
bin/magento setup:upgrade

Upgrade composer form v1 to v2

composer self-update --2
sudo composer self-update 2.1.14

You can go back at any time by using 
composer self-update --1
or 
Use: composer self-update --rollback 

This command allows Composer to rebuild the mapping to project files so that they load faster.

composer dump-autoload -o --apcu

Show Magento version List 

composer show magento/product-enterprise-edition 2.3.* --all | grep -m 1 versions
composer show magento/product-enterprise-edition --all | grep -m 1 versions
composer show magento/magento-cloud-metapackage --all | grep -m 1 versions
composer show mageplaza/magento-2-french-language-pack --all | grep -m 1 versions

Create M2 project

composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.1.18 <install-directory-name>

composer create-project --repository-url=https://repo.magento.com/ magento/project-enterprise-edition=2.4.0 <install-directory-name>

composer create-project --repository-url=https://repo.magento.com/ magento/project-enterprise-edition=2.4.3-p1 <install-directory-name>

composer create-project --repository-url=https://repo.magento.com/ magento/project-enterprise-edition=2.4.5-p1 <install-directory-name>

Upgrade M2 

For CE
sudo composer require magento/product-community-edition 2.2.4 --no-update

For EE
sudo composer require magento/product-enterprise-edition 2.4.3-p1 --no-update

For Cloud
sudo composer require magento/product-enterprise-edition 2.4.3-p1 --no-update
sudo composer require "magento/magento-cloud-metapackage":">=2.4.3 <2.4.4" --no-update
sudo composer install

Apply Patch for Adobe Commerce & Magento Open Source

Install the latest quality patches package: ./composer require magento/quality-patches
Apply the patch: ./vendor/bin/magento-patches apply ACSD-45520
Clean the cache: ./bin/magento cache:clean
ACSD-45520: Swatch options not selected on product detail page

Update ece-tools 

sudo composer update magento/ece-tools --with-dependencies
composer require magento/quality-patches

View path in magento version

./vendor/bin/magento-patches status 

Apply individual patches

./vendor/bin/magento-patches apply MAGETWO-XXXX
./vendor/bin/magento-patches apply MAGETWO-XXXX MAGETWO-YYYY

Revert all applied patches:

./vendor/bin/magento-patches revert MAGETWO-XXXX
php ./vendor/bin/ece-patches revert
./vendor/bin/magento-patches revert --all

Add MDVA-ID to Magento Cloud

stage:
  global:
    SCD_ON_DEMAND: true
  deploy:
    MYSQL_USE_SLAVE_CONNECTION: true
    CRON_CONSUMERS_RUNNER:
      cron_run: true
      consumers: []
  build:
    QUALITY_PATCHES:
      - MDVA-34023
      - MDVA-12304
      - MDVA-30232
      - MDVA-28656
      - MDVA-30106
      - MDVA-23764

No comments:

Post a Comment