if you are magento 2 developer so this post is helpful to you. before I created one blog called “Magento 2 useful command Part 1” so I mentioned some command related to Cache, Admin, Modules, Indexer and Info commands. in second blog “Magento 2 useful command Part 2” I mentioned some command related to Store, Deploy, Available, Sampledata, Cron, Config and Braintree etc. now I am mentioning in this blog related to some other commands like Setup.
1) It takes backup of Magento 2 application code, media and database
Command :
php bin/magento setup:backup
OR
php bin/magento s:b
2) It creates or modifies the deployment configuration in magento 2.
Command :
php bin/magento setup:config:set
OR
php bin/magento s:c:s
3) It installs and upgrades data in the DB
Command :
php bin/magento setup:db-data:upgrade
OR
php bin/magento s:db-d:u
4) It generate patch and put it in specific folder
Command :
php bin/magento setup:db-declaration:generate-patch
5) It generate whitelist of tables and columns that are allowed to be edited by declaration installer things.
Command :
php bin/magento setup:db-declaration:generate-whitelist
6) It installs and upgrades the Database schema
Command :
php bin/magento setup:db-schema:upgrade
OR
php bin/magento s:db-s:u
7) It checks if Database schema or data requires upgrade
Command :
php bin/magento setup:db:status
OR
php bin/magento s:d:s
8) It generates DI configuration and all missing classes that can be auto-generated.
Command :
php bin/magento setup:di:compile
OR
php bin/magento s:d:c
9) It upgrades the Magento application, DB data, and schema
Command :
php bin/magento setup:upgrade
OR
php bin/magento s:up
10) It installs the Magento application
Command :
php bin/magento setup:install
OR
php bin/magento s:i
11) It generates fixtures.
Command :
php bin/magento setup:performance:generate-fixtures
OR
php bin/magento s:p:g
12) It rolls back Magento Application codebase, media and database
Command :
php bin/magento setup:rollback
OR
php bin/magento se:ro
13) It deploys static view files/content
Command :
php bin/magento setup:static-content:deploy
OR
php bin/magento s:s:d
14) It generate static content deploy for particular language using command line
Command :
php bin/magento setup:static-content:deploy en_US
OR
php bin/magento s:s:d en_US
15) It generate static content deploy for magento backend theme using command line
Command :
php bin/magento setup:static-content:deploy --theme="Magento/backend"
OR
php bin/magento s:s:d --theme="Magento/backend"
16) It generate static content deploy for specific themes using command line
Command :
php bin/magento setup:static-content:deploy --theme Magento/luma --theme Magento/second_theme
OR
php bin/magento s:s:d --theme Magento/luma --theme Magento/second_theme
17) It exclude themes on static content deploy and does not minify HTML files using command
Command :
php bin/magento setup:static-content:deploy en_US --exclude-theme Magento/luma --no-html-minify
OR
php bin/magento s:s:d en_US --exclude-theme Magento/luma --no-html-minify
18) It installs the store configuration. deprecated since 2.2.0. Use config:set instead of this command.
Command :
php bin/magento setup:store-config:set
OR
php bin/magento s:s:s
Write-up
In webdeveloperindia tutorial, I have covered some basic Magento commands. I hope you got this tutorial very useful. If you want to give any feedback or share it in the comments section below.
Hello, Welcome to webdeveloperindia.in. I am a full-stack web developer. Email – [email protected] | Skype – azaruddin23. I have knowledge of PHP, Laravel, Magento 1/2, Codeigniter, WordPress, Joomla, Shopify, Git, Bitbuket, jQuery, Ajax, Javascript and ReactJS.