Skip to main content

upgrade magento 2

bin/magento maintenance:enable
composer require magento/product-community-edition 2.2.0 --no-update
composer update
rm -rf var/cache/*
rm -rf var/page_cache/*
rm -rf var/generation/*
chmod +x bin/magento
bin/magento setup:upgrade
 php bin/magento setup:di:compile
bin/magento maintenance:disable

For further upgrades, change the version number:

composer require magento/product-community-edition 2.2.2 --no-update


rm -rf pub/static var/cache var/page_cache
rm -rf var/cache
rm -rf var/page_cache
rm -rf var/view_preprocessed

 php bin/magento cache:clean
  php bin/magento cache:flush

php bin/magento setup:static-content:deploy -f

php bin/magento module:status      -- to check activated modules




Step 1: Access Your Server via SSH

You need to connect your server via SSH.

Step 2: Navigate to the Magento 2 Root Directory

Once your SSH connection is up, you will need to move to your target application folder. In that application folder, you will find the public_html folder which is the root directory of Magento 2.

Step 3: Upgrade Commands

composer require magento/product-community-edition 2.1.9 --no-update

Then execute this all commands

 composer update
 rm -rf var/di var/generation
 php bin/magento setup:upgrade
 php bin/magento setup:di:compile
 php bin/magento cache:clean
 php bin/magento cache:flush
 php bin/magento indexer:reindex

 php bin/magento module:status

 php bin/magento module:disable <ExtensionProvider_ExtensionName>
 php bin/magento module:disable Prince_Buynow
 - php bin/magento module:disable SR_CategoryImage
 - php bin/magento module:disable Clapcreative_CategoryImage
 - php bin/magento module:disable Atwix_CategoryAttribute
 - php bin/magento module:disable Livenation_HelloWorld

 php bin/magento deploy:mode:show

 php bin/magento deploy:mode:set production --skip-compilation

 php bin/magento deploy:mode:set developer --skip-compilation


chmod -R 0777 pub/static/
chmod -R 0777 var/cache/
chmod -R 0777 var/page_cache


add these 3 lines to show errors
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);



Comments

Popular posts from this blog

Magento 2: Category list for custom magento system configuration section ( Backend )

In system.xml file field for multi select of category is like: NOTE: Use Select for Single item and multiselect for multiple in - <field id = "bannerlist" translate = "label" type = " multiselect " <group id = "bannerblock_setting" translate = "label" type = "text" delault = "1" sortOrder = "3" showInDefault = "1" showInWebsite = "1" showInStore = "1" > <label> Setting </label> <field id = "bannerlist" translate = "label" type = "multiselect" sortOrder = "10" showInDefault = "1" showInWebsite = "1" showInStore = "1" > <label> Select Category </label> <!-- <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>--> <source_model> Ipragmatech\Bannerblock\Model\Config\Source\C...

Magento 2: Get Products by category ID

<?php $objectManager =  \Magento\Framework\App\ObjectManager::getInstance();        // $appState = $objectManager->get('\Magento\Framework\App\State'); // $appState->setAreaCode('frontend'); $categoryFactory = $objectManager->get('\Magento\Catalog\Model\CategoryFactory'); $categoryHelper = $objectManager->get('\Magento\Catalog\Helper\Category'); $categoryRepository = $objectManager->get('\Magento\Catalog\Model\CategoryRepository'); $store = $objectManager->get('Magento\Store\Model\StoreManagerInterface')->getStore(); $categoryId = 47; // YOUR CATEGORY ID $category = $categoryFactory->create()->load($categoryId); $categoryProducts = $category->getProductCollection()                              ->addAttributeToSelect('*');       ...