Magento 2 migration best practices


This tutorial provides a list of all important points which we should keep in mind while doing application migration from one environment to anther. Your can say this tutorial is the cheat sheet of best migration practices for magento 2.

Ensure following directories are cleared

  • var/page_cache : It includes full page cache
  • var/cache : It contains all cacheable objects excluding page cache.
  • var/composer_home : It contains setup wizard artifacts
  • var/generation : it contains generated code
  • var/di : it contains the compiled dependency injection configuration for all modules.
  • var/view_preprocessed : It contains minified templates and compiled LESS

Ensure proper deployment mode is set

How many types of deployment mode in magento 2  

There are 3 deployment mode in magento 2

  • default : it is not optimized for default
  • developer: Optimized for developer
  • production: Optimized for production

To see the deployment mode

php bin/magento deploy:mode:show

To set/update deployment mode

php bin/magento deploy:mode:set


Ensure proper indexer mode is set

How to optimize indexer in magento 2
Command to see all indexers details in Magento 2

php bin/magento indexer:info

To set indexer modes

php bin/magento indexer:set-mode

To show indexer modes

php bin/magento indexer:show-mode

View the status of all indexers or specific indexers

php bin/magento indexer:status [indexer]

Related posts:

The following two tabs change content below.

Chandra Shekhar

Consultant at Infogain
Chandra Shekhar is a LAMP Developer,Thinker,Blogger and currently working as Magento(Ecommerce) specialist.. I am always open to learn new things in LAMP as well as other newer technology. In the journey of my last 9 years of web and product development, I have decided to share my knowledge and experience to Open Source Community in 2011. In this regard I have started Since then I am actively sharing my knowledge on various LAMP technology through’s technical ... Read More about Chandra Shekhar

Latest posts by Chandra Shekhar (see all)