Skip to main content

Command line interface

The Advanced Reports extension for Magento 2 adds the following commands. Run them from the Magento root directory.

Export reports​

php -f bin/magento mirasvit:advanced-reports:export [options]

Builds a report and saves it to a file in the var/export folder of your Magento installation. The command prints the full path of the file when it is done.

The file name has the following format: report_[identifier]_[interval]_[export-date]_[export-time].[type].

OptionDescription
--identifierThe identifier of the report to export, for example order_plain. Required. Run the command with --report-list to see all identifiers.
--typeThe file type: csv or xml. Required.
--intervalThe date interval of the report, for example last30Days. Run the command with --interval-list to see all intervals. If omitted, the lifetime report is generated.
--fromThe start date of a custom interval, in the YYYY-MM-dd format (for example, 2026-02-10). Used only with --interval custom. If omitted, the report starts 10 years before today.
--toThe end date of a custom interval, in the YYYY-MM-dd format. Used only with --interval custom. If omitted, the report ends 10 years after today.
--report-listLists all available reports (identifier and name).
--interval-listLists all available date intervals (code and description).

For example, to export the Orders report for the last 30 days as a CSV file:

php -f bin/magento mirasvit:advanced-reports:export --identifier order_plain --type csv --interval last30Days

To export it for a custom period:

php -f bin/magento mirasvit:advanced-reports:export --identifier order_plain --type csv --interval custom --from 2026-01-01 --to 2026-03-31

Send email notifications​

php -f bin/magento mirasvit:advanced-reports:cron

Runs the email notifications cron job manually. It sends the active email notifications whose schedule matches the current minute, the same way the cron job does every minute.


Update geo-data​

php -f bin/magento mirasvit:advanced-reports:postcode:cron

Runs the two postal code cron jobs manually: the first collects new postal codes from order addresses, the second looks up their locations. See How to manage geo-data.


Import postal codes​

php -f bin/magento mirasvit:advanced-reports:geo-import

Downloads the postal code files published by Mirasvit and imports them, with their locations, into the database. Use it to fill in the data for the Sales by Geo-data report at once instead of waiting for the cron jobs. See How to manage geo-data.


Show table relations​

php -f bin/magento mirasvit:advanced-reports:info

Displays how the database tables that reports can use are joined to each other, and marks the pairs of tables that are not related as NOT RELATED. This helps when you build a report from columns of several tables.


Test reports​

php -f bin/magento mirasvit:advanced-reports:test

Builds every report and shows how long each one takes and how many rows it returns. Use it to find slow reports.