User Tools

Site Tools



For more details see how the Export Orders for Magento 2 extension works.

Guide for Export Orders for Magento 2

Connect your Magento instance to other systems and efficiently export orders to them. Add to export file any order data, fields from 3rd-party extensions, create order export profiles and migrate orders regularly.

  • Build export profiles in 6 various formats
  • Easily find any order entity and add it to the export file
  • Change the names of columns in a file to meet the recipient requirements
  • Execute profiles by schedule, event or manually
  • Use filtering to add only relevant order data to the export file
  • Check extended options with the 2 extra Amasty Export modules
The new Amasty_OrderExport extension is not compatible with the previous Amasty_Orderexport. If you have the old vesrion of the extension, please, follow the steps below to avoid conflicts:
  1. Disable Amasty_Orderexport with the command:
bin/magento module:disable Amasty_Orderexport
  1. Run the command:
bin/magento setup:upgrade


The Export Structure

Amasty Export by now has 3 separate modules to carry out export tasks:

  • Export Orders: a separate export to deal with order entities
  • Amasty Export: suitable for one-time export of any available entity
  • Amasty Export PRO: a tab to create cron jobs concerning export activity

The more Amasty modules you have, the more entities you will be able to export in the fist simplified module and in the PRO version. Follow Import & Export solution updates to discover new possibilities.

Keep in mind, that if your export managers have specific permissions to the admin panel, you need to grand them access to both Export Orders Profiles and Amasty Export. Otherwise, they won't be able to execute the export.

Export Orders Configuration

Before building export profiles, configure the basic order export options.

Read this article to see top 6 most common use cases and how to set them up.

Go to Stores → Configuration → Amasty Extensions → Export Orders.

Enable module - select Yes to activate the extension.

Export Batch Size - set the number of orders that will be processed in an iteration.

Log Auto-Cleaning - choose Yes to clean logs automatically. The records will be removed from Export History after the period specified below.

Log Auto-Cleaning Period (Days) - define the period after which export history will be cleaned.

Export Files Auto-Cleaning - if enabled, the generated export files will be automatically removed from the server after the period specified below.

Export Files Auto-Cleaning Period (Days) - identify the period after which the files will be removed from the server.

Enable Multi-Process Export - set to Yes to speed up the export of orders. Remember, that this option is added specifically for orders. The multi-process for Amasty Export and Amasty Export Pro should be enabled in the other tab.

The 'Multi-Process Export' feature requires the PHP extension 'pcntl' to be installed on the server. If you enable the feature and no performance boost happens, please ask your hoster/system administrator to check if the 'pcntl' extension is installed.

Number of Parallel Processes - specify the number of processes according to your server capabilities. The more parallel processes are set, the faster the export process goes, but the higher the server loads.

Enable Email Alert - choose Yes to notify the recipients when the export fails.

Email Sender - select the contact that will send automatic emails.

Email Recipients - specify to whom the emails will be sent.

Email Template - choose the template for a failure notification.

Export Order Profiles

The extended order export functionality allows you to create flexible profiles for export and execute it on regular basis. To view all the profiles, proceed to System → Export Orders → Profiles.

You can view, delete, add new profiles or run any of them manually right from the grid.

To create a new one, hit the Add New Profile button and follow a profile set up steps.

General Configuration

In the first tab adjust the general information of the profile.

Profile Name - specify the name of the profile for internal usage. This name will be displayed in the grid.

Export Only New Entities - the previously exported orders will be skipped if the setting is enabled. The option is useful in case you export the profile regularly and only newly created orders are needed.

Batch Size - set the number of orders that will be processed in an iteration. You may configure batch size for each profile separately or specify the value in general configuration and use this default value.

Actions With Orders After Exporting

You can also automatically execute particular actions when the orders are exported.

Change Processed Orders Status To - specify the status that exported orders will get.

Add Comment to Status History - comment would be added to the order status history after exporting.

Invoice, Ship or Cancel orders after the export if needed. When any of these actions are enabled, you can additionally notify customers.

Output Options

Proceed to the configuration of output options.

File Name - specify the title for the export file.

Use {date|format} to customize filename. Example: Filename-{date|Y_m_d_h_i_s}. Here you may find more options for date format.

Compress Export File With Gzip - enable the toggle to compress the file and save extra space on a server.

Export File Storage

Specify where to export the profile: on internal or external server, send the exported file by email or using API.

If Store Exported File On Server is enabled, provide File Path and File Name on Server. The file will be saved in Magento 'var' directory relative to the specified path.

If you want to Upload Exported File By FTP / SFTP, you will need to fill the following fields:

  • Host
  • User
  • Password
  • File Path
  • File Name for FTP/SFTP.

For FTP you can also enable a Passive Mode.

In case you want to Send Exported File to E-mail, provide:

  • Email Sender
  • E-mail Recipients
  • E-mail Message Subject
  • Email Template.

If you are using Send to Rest Api Endpoint, provide:

  • Rest Api Endpoint
  • Auth (No Auth / Bearer / Basic)
  • Method (POST / PUT)
  • Content Type (JSON / XML).

File Settings

On the following step, you need to choose the required file type and configure its general settings.

The following formats are available:

  • CSV
  • XML
  • ODS
  • XLSX
  • JSON
  • Template

For CSV, ODS and XLSX formats you can:

Add Header Row - column titles will be displayed in this row.

Merge Rows into One - data from multiple rows will be merged into one cell if enabled. The character that delimits each field of the child rows is customizable. Check the GIF in a demo to see how it works.

For a CSV file you can additionally set:

  • Field Delimiter
  • Field Enclosure Character

For a XML file you can customize:

  • XML Item Tag
  • Header
  • Footer

For JSON specify:

  • Header
  • Footer

For Template:

Using the Template option, you can build a unqiue file suitable for specific needs. Thanks to the integrated Twig PHP template engine, you can create any template you want to:

See Twig documentation to learn more about the features and configuration.

Fields Configuration

In this tab, you can start building your export file by choosing the data to export. The functionality has a tree structure. Thus, you can add any entity, any field within a particular entity, customize prefixes/tags/delimiters and so on to match the requirements of the system you are exporting to.

See how the tree-structures file is built:

Step 1. Add root entities

First, you need to configure the basic order entity and select the fields that will be added to the file on the root level.

Click Add Fields button and choose the relevant data to add to the export file.

Use a search window right in the popup to find the required fields faster. Click Add Selected Fields.

When a field is added, you can customize a column title that will be displayed in the exported file. Moreover, use the Add Static Filed button to create columns that will remain unchanged in the file.

Also, for each file level, you can set a custom entity key, delimiter and a field name. Check how it works:

Step 2. Add subentities

Then you can go down the entity list and enable any you need.

Just hit the Enabled toggle and Add Fileds button. As it was described above, a popup will appear and you will be able to add all required fields concerning a particular entity. For example, for the Order Item entity, you may add product type, sku, price, etc.

The same can be done for the entities with a lower level, such as Order Item Attribute or Order Item Custom Option.

Also, the extension support MSI functionality. You can find the required fields on the Shipment level in the Inventory Source tab.

Thus, you can build a unique profile, suitable for a particular system. Check the requirements from a system (as, for example, ERP or B2B invoicing company needs different order data) and match the details.

Adding Product Attributes

To include particular product attributes into the export profile, navigate to Stores → Attributes → Product.

For example, we want to add a manufacture attribute. So, we open a particular attribute and proceed to the Order Export tab.

Choose Yes in the Add to Options field and Save the attribute.

After that, you need to run Reindex, as the attribute will become available in the export configuration profile only after the reindexation.

Check the result. You will see manufacture attribute in the Fields configuration tab of the export profile (Order Item → Order Item Attribute section).

Also, now you can filter orders by the added product attribute.

Export Filters

In the next tab, you can define which orders should be exported using filtering. For example, you may add only configurable products to the export file. Filtering also has a tree structure and is on the same level as export fields.

Expand the necessary entity, click Add Filter and specify the value you need to export.

Additionally, you can Exclude Parent Entity Row If No Results Found. It means that the parent entity row will be excluded from the export file if the child entity doesn't have filter results relative to the parent entity.

Check how it works:

Automatic Export

Set the frequency to run the profile. 2 modes to run a profile are available:

  • by Cron
  • by event

For exporting by cron, you need to set one of the ready-made schedules or create a custom one.

For exporting by event, choose the particular event that will trigger a profile export.

Profile Export History

For each profile a separate export history is available. Check the statuses, dates, logs and the exported number of orders. Download a file if necessary.

General Export History

You may also check the logs for all exported profiles in one place. Navigate to System → Amasty Export → Export History. See the statues and check details to get a full picture.

With the extension, you can link the data generated by 3rd party extensions to the export functionality. All created connections are displayed in the System → Export Orders → 3rd Party Connections tab.

Hit the Add New Connection button to create a new link.

Name - specify the connection title for internal usage.

Table to Join - indicate a table name that needs to be joined.

Parent Entity - choose the entity table to which the foreign table will be joined.

Referenced Table Key - the field from the foreign table, by which the table chosen in 'Table to join' will be joined to the parent entity table.

Base Table Key - specify the field from the parent entity table which will be used for joining with the foreign table.

Save the changes. Now you can add this entity to the export file.

Amasty Export: Fast & Easy

This extension is helpful to perform one-time operations as it has a simplified UI. If you have only Export Orders extension, you will be able to export any order entity, but if you have other export extensions by Amasty, you will easily export any available entity in one place.

Go to System → Amasty Export → Export and select the entity to export.

As soon as you choose the entity, you will be able to configure export details, such as format, title, included fields, etc. Check each configuration details for each tab in the Export Profile Configuration sections.

General Settings

To configure the basic options for Amasty Export, navigate to Stores → Configuration → Amasty Extensions → Export.

Enable Multi-Process Export - set to Yes to speed up the export.

The 'Multi-Process Export' feature requires the PHP extension 'pcntl' to be installed on the server. If you enable the feature and no performance boost happens, please ask your hoster/system administrator to check if the 'pcntl' extension is installed.

Number of Parallel Processes - specify the number of processes according to your server capabilities. The more parallel processes are set, the faster the export process goes, but the higher the server loads.

Amasty Export Pro

Also, the extension includes Amasty Export Pro features: you can create regular cron jobs to export any available entity.

Go to System → Amasty Export → Cron Jobs.

The more installed Amasty Export extensions you have, the more entities you can export by cron.

Click New Export Job.

Specify the cron job title for internal use and set the schedule for exporting. The file configuration algorithm is the same as described in the Export Profile section.


Export orders are compatible with Amasty Order Attributes extension. Thus, you can find and add custom order fields to the export file.

Also, the extension supports Amasty One Step Checkout so that you could add more order details from your checkout page to the export file.

Find out how to install the Export Orders extension for Magento 2 via Composer.

Rate the user guide
 stars  from 1 votes (Details)
magento_2/export_orders.txt · Last modified: 2020/12/28 11:23 by skudrov