Skip to content
Marco Pestrin edited this page Jun 8, 2018 · 19 revisions

Usage / Commands

(The document is a little bit outdated. Up to date list of commands are in README).

All commands try to detect the current Magento root directory. If you have multiple magento installation you must change your working directory to the preferred installation.

List all commands by a simple:

n98-magerun.phar list

Database Commands

Print database informations

n98-magerun.phar db:info

The command output looks like this:

host                     : localhost
username                 : root
password                 : mypassword
dbname                   : mydatabase
initStatements           : SET NAMES utf8
model                    : mysql4
type                     : pdo_mysql
pdoType                  :
active                   : 1
PDO-Connection-String    : mysql:host=localhost;dbname=mydatabase
JDBC-Connection-String   : jdbc:mysql://localhost/mydatabase?username=root&password=mypassword

Dump database

Direct dump with mysqldump:

n98-magerun.phar db:dump

The command will ask for the dump filename.

Only the mysqldump command:

n98-magerun.phar db:dump --only-command

For deveopment/staging:

n98-magerun.phar db:dump --strip="@development"

Useful for deploying to staging server where you don't want customer data/orders

Global Config Commands

Generate local.xml file

n98-magerun.phar local-config:generate

Dump global xml config

n98-magerun.phar config:dump > extern_file.xml

Cache Commands

List magento cache status

n98-magerun.phar cache:list

Clean magento cache

n98-magerun.phar cache:clean

Or only one cache type like i.e. full_page cache:

n98-magerun.phar cache:clean full_page

List magento caches

n98-magerun.phar cache:list

Disable magento cache

n98-magerun.phar cache:disable

Enable magento cache

n98-magerun.phar cache:enable

Admin Commands

List admin users

n98-magerun.phar admin:user:list

Change admin user password

n98-magerun.phar admin:user:change-password

Disable admin notifications

Toggle admin notifications.

n98-magerun.phar admin:notifications

System Commands

Toggle maintenance mode

n98-magerun.phar sys:maintenance

Magento system infos

Provides infos like the edition and version or the configured cache backends.

n98-magerun.phar sys:info

Magento modules

Lists all installed modules with codepool and version

n98-magerun.phar sys:modules:list

Magento stores

Lists all store views.

n98-magerun.phar sys:store:list

Run Setup Scripts

Runs all setup scripts (no need to call frontend). This command is useful if you update your system with enabled maintenance mode.

n98-magerun.phar sys:run-setup-scripts

Developer Commands

Toggle Template Hints

Toggle debug template hints settings of a store

n98-magerun.phar dev:template-hints <store_code>

Toggle Template Hints Blocks

Toggle debug template hints blocks settings of a store

n98-magerun.phar dev:template-hints-blocks <store_code>

Toggle Inline Translation

Toggle settings for shop frontend:

n98-magerun.phar dev:translate:shop <store_code>

Toggle for admin area:

n98-magerun.phar dev:translate:admin

Toggle Profiler

Toggle profiler for debugging a store:

n98-magerun.phar dev:profiler <store_code>

Toggle Symlinks

This command is useful if you work with a tool like modman which requires allowed symlinks.

Allow usage of symlinks for a store-view:

n98-magerun.phar dev:symlinks <store_code>

Global scope can be set by not permitting store_code parameter:

n98-magerun.phar dev:symlinks

Magento Connect

List Extensions

List and find connect extensions by a optional search string:

n98-magerun.phar extension:list <search>
  • Requires magento's mage shell script.
  • Does not work with windows as operating system.

Install Extensions

Installs a connect extension by package key:

n98-magerun.phar extension:install <package_key>

If the package could not be found a search for alternatives will be done. If alternatives could be found you can select the package to install.

  • Requires magento's mage shell script.
  • Does not work with windows as operating system.