Magento 2: Useful Configuration Settings & CLI Commands for Development Environment

This article shows some of the configuration settings and CLI commands that are useful for developers in their development environment. For example, enabling logging, enabling template path hints, disabling forced admin password change, etc. Disable password change From Magento admin Stores > Configuration > Advanced > Admin > Password Lifetime(days) = 0 Stores > Configuration … Read more

Magento 2: Add Custom Console CLI Command in your Module

Magento allows to create custom console commands to the Symfony-like command-line interface (CLI). The Console component allows you to create command-line commands. You can create custom console commands for any task like import, export, or other batch jobs. In this article, I will be creating a custom Magento2 module and will add a custom console … Read more

Backup & Restore Magento2 Database using N98-magerun2

n98-magerun is a handy CLI tool to work on Magento from command line. Backup/Dump Database Backup Database in a plain SQL File n98-magerun2.phar db:dump var/projectName_date.sql Print only the MySQL command. Do not execute it. This can be done by using the –only-command option. n98-magerun2.phar db:dump –only-command var/projectName_date.sql You may also use the time command which … Read more

Magento 2: Unlock Reindex Process via Command Line

This article shows how you can unlock the locked reindexing process Magento 2 via command line. Problem Sometimes a scenario comes when the indexing process gets locked at the time of reindexing. When the process or the index type is locked then you cannot reindex that particular locked index type. The reindex will always skip … Read more

Magento 2: Enable/Disable Module via Command Line

This article shows how you can enable or disable Magento 2 modules using the command line. In my previous article, I have listed out all the command line tools that can be used in Magento 2. This article specifically shows about commands to enable/disable Magento 2 modules. Get the List of All Modules First of … Read more

Magento 2: Maintenance mode via Command Line

This article shows how you can enable or disable Maintenance mode in Magento 2 using the command line. In my previous article, I have listed out all the command line tools that can be used in Magento 2. This article specifically shows about commands to enable/disable maintenance mode in Magento 2. Check Maintenance Mode Status … Read more

Magento 2: Reindex via Command Line

This article shows how you can reindex Magento 2 index types using the command line. In my previous article, I have listed out all the command line tools that can be used in Magento 2. This article specifically shows about commands to reindex Magento 2 index types. Get Index Types Info First of all, let’s … Read more

Magento 2: Enable/Disable/Clear Cache (Clean/Flush) via Command Line

This article shows how you can clear Magento 2 cache using command line. In my previous article, I have listed out all the command line tools that can be used in Magento 2. This article specifically shows about commands to clear Magento 2 cache. Check Cache Status First of all, let’s see what is the … Read more