Released n98-magerun version 1.91.0

We are happy to present you a new stable release of n98-magerun.
The new release contains many new features and some enables users of Microsoft Windows some features which was only
available for MacOS/Linux users.

Let’s see what we have changed since the last release…

Remove Admin-Users and Customers

We have two new commands to remove admin (backend) users and (frontend) customers.

Customers can be deleted by a ID range or by defining a email address.


As analog command we have the new command to delete an admin user:

  • #370 Remove Admin Users (by Aydin Hassan)
  • #380 Customer delete command (by Michael Woodward)

Better Microsoft Windows Support

We added support for user config and n98-magerun modules.
Now you can add your own user specific config in %userprofile% folder. To make it a little bit easier we removed the leading
dot which is normal on Unix but could produce problems on Windows machines.
A system wide config is also possible under the path %windir%\n98-magerun.yaml

For an overview please refer the wiki pages:

Generate model method for magic getter/setter

We added our first command to a new command namespace “code”. The namespace is designed to add code generator command to n98-magerun.
We start with a command to generate getter/setter of models.

Before (do not use this with code models):




  • #376 New command dev:code:model:method (by Cyrill Schumacher)

Change Resource Versions

A very useful new command sys:setup:change-version allows you to set the version of a single resource setup or of all
resource setups of a module from cli.

  • #382 Change module version command (by Michael Woodward)

Other fixes and enhancements

  • #299 Removed header if format parameter is passed (by Christian Münch)
  • #303 Please warn instead of blocking input (by Christian Münch)
  • #315 sys:setup:run on enterprise requires admin session. (by Thorsten Essig and Christian Münch)
  • #362 db:import –optimize: Cut line in 8MB pieces (by Alexander Menk)
  • #367 Exclude sessions from @stripped (and therefore @development) (by Aaron Brady)
  • #368 Skip sys:setup:incremental’s Version Check (by Alan Storm)
  • #369 get use_rewrites/use_secure from config (Kristof Ringleff)
  • #352 Added –stop-on-error option. (by Christian Münch)
  • #372 print root warning to std_error (by Edward Rowley)
  • #373 Refactored local-config:generate command (by Rouven Rieker)
  • sys:info command: Added row count for main entities (by Christian Münch)
  • sys:setup returns exit status code “1” if setup fails (by Christian Münch)
  • Updated 3rd party components (Symfony, PHPUnit, Twig)


Please run n98-magerun.phar self-update to fetch the new version.


LimeSoda Environment Configuration

This article is part of a series covering 3rd party n98-magerun modules/extensions.

The next article presents a solution to manage several developer, staging, production environements with a n98-magerun module and and a Magento module (can be installed at once).
If you have multiple Magento environments i.e. for all your developers you know the problem. Someone dumps a database and share it with another developer. Now every developer runs in the same boring issue. Changing the configuration according to the current environment. The list of configurations grows and grows… You know the problems.

At this point the solution of Limesoda can help you.


You need to install the file directly in your Magento installation via modman.

After the installation you must define the name of your config environment. This can be done in config.xml (in this case
the app/etc/local.xml file).

Define your dev-environment:

Default environment

Create a new Magento module to define a config. Add a global > limesoda > environments node to your config.xml file.

This was easy! We have our first default environment defined.

Now we can run n98-magerun with the new embedded command.

The output is currently empty, because our environment has no commands defined.

Define commands

Now we extend the previous config and add some n98-magerun commands. You can call every n98-magerun command as batch.

This calls two config settings and a cache flush sequentially.

Using variables

If you look at the previous example you see that we used the same url two times. Let’s create a varible for that and see how simple is is to use a variable.

Run n98-magerun again and you should see that output:

Nesting environments

This was very cool, but nesting the environments is really hot!
Let’s do it.
You can do it by adding the attribut parent to your environment definition in XML.

A typical setup could be:

Now we define this setup in our config:

The command processes your configs recursivly. That’s the power of the LimeSode Environment Configuration module.

If you like this way to manage your environments give the modules a change.
You can fetch the module from github.


MageRun Addons by Kalen Jordan

This article is part of a series covering 3rd party n98-magerun modules/extensions.

Kalen Jordan (creator and founder of MageMail) is one of our longest n98-magerun users and contributors.
He was the first who published a 3rd party module with some nice commands. That’s what i like to present you now (mostly copied from module README).

You can find the module here:

Installation is really simple:

Bust Frontend Browser Caches

This command modifies the skin and js base URLs with a timestamp-specific URL, so that browsers will pull down fresh CSS and JS.

It’s intended to be used in conjunction with a web server rewrite rule that will rewrite, for example:


Create dummy order

This command can create some dummy orders. It’s marked as experimental but could help you to create dummy data in your shop i.e. for performance tests.

Assign order to new customer

This command can assign an order to a new customer by ID.
This is very experimental – doesn’t modify all of the places that customer data exists on the order models, such as the shipping and billing address – just the customer name, email, ID on the order entity.


Assigns the order #10000000001 to customer ID 10.

Anonymize customer data

Anonymize customer data across a bunch of tables: order, order address, newsletter, quotes, newsletter subscriber.

Core file diff / Theme diff

This command can diff core files to see if they have been modified.
The command depends the command line tool diff which should be installed on all unix based systems.



Same functionality for theme files:

See what customizations have been made in your custom theme against the base theme.

Grab mailchimp unsubscribes

Grab all of the mailchimp unsubscribes to your primary list

If you’re using Ebizmarts_MageMonkey to manage your Mailchimp integration, this will allow you to grab a list of all of the unsubscribed emails to your primary list.

The main purpose for doing this is if you need to import these unsubscribes somewhere. The routine will dispatch an event mailchimp_list_unsubscribe_discovered which you can observe in order to handle them.

Uninstall a module

ninstall a module by deleting all the module’s files and removing database tables.

NOTE: This is not fully baked yet, at the moment it just deletes the main module config file and the code directory. Pretty trivial, but I’m going to add in database tables, layout files, template files, etc.

Generate gift card codes

The missing tool to generate EE gift card codes!