How To Import and Export Orders to Magento 2

Magento 2 Orders Import

Below, we describe how to import orders to Magento 2 in the most natural way. The process is necessary for migrating from your old store to a Magento 2 website or transferring data from a connected marketplace.

'

The Magento 2 ecosystem offers multiple order import extensions that simplified the way you move orders to your store, but the most fully-featured solution is the Improved Import & Export Magento 2 module.

First of all, it provides the ability to import orders to Magento 2 using multiple file formats. Of course, it is possible to transfer data files via standard CSV. For instance, you can import orders to Magento 2 via CSV from your old Magento 1 website or other platforms that create the corresponding output.

The second supported file format is XML. It is flexible and extremely popular among multiple e-commerce systems and tools. Feel free to use the Improved Import & Export Magento 2 extension to import orders to Magento 2 via XML.

Besides, there is support for TXT files. If an external system generates order data in this format, the Improved Import & Export Magento 2 extension will quickly move all orders to your store.

Another essential feature of the module is the ability to work with JSON files. With the full support for this format, you can easily import orders to Magento 2 via JSON. It allows simplifying the migration from Shopify to Magento 2.

Besides, native Excel files are supported. Thus, you can run Magento 2 order import from XLS and XLSX sheets without any negative consequences.

Furthermore, the Improved Import & Export Magento 2 extension is integrated with Google Sheets. Thus, you can avoid using data files to move information to your e-commerce store. Feel free to leverage the extension’s functionality to run orders import to Magento 2 right from Google Sheets.

Magento 2 Google Sheet import

How the order import works

Order import would be incomplete without Magento 2 order export functionality. Try the order export procedure to get the sample file and see how the orders with their attributes can look in either CSV or XML.

We use the standard CSV format for our sample files. Let’s have a look at the order CSV table and to learn how it is composed and how different order attributes behave. Knowing the principle of the attributes’ work will help you understand the peculiarities of the import procedure.

Visit Master Google Sheets Table for a sample file

Explore Magento 2 order file structure

The list of order attributes is relatively extensive, however, to perform a successful import you can go with just the required ones. Both options you can find in our Master Google Sheets Table, compare them, and follow the improved import logic.

Get a sample CSV file with full order attributes

Get a sample CSV with only required order attributes

As per the sample above we can see that the orders are exported from the database preserving all attributes and values as they are stored in the DB.

When importing orders one needs to remember the following peculiarities:

  1. Orders are imported using both entity_id and increment_id attributes.
    entity_id – is an internal order identifier used by Magento 2 to get the place for the order in the database. Magento 2 assigns entity_id automatically depending on the IDs already in the database. If the imported order has the same ID as the order already at the store – Magento 2 will assign a new ID to it automatically.
    The order is not represented in the order details screen. The only way to see it from the Magento 2 admin panel is to look at the order details screen URL.
    increment_id – is an actual order number, a unique order number that can be found in the order grid and in the invoice. The value is unique, two orders with the same increment ID cannot be processed by Magento 2.
  2. The products are assigned to orders using their SKUs. If the store doesn’t have a product with an SKU it is tied to, the imported order will still have a product reference. However, ‘reorder’ functionality will not be available.
  3. The customers are assigned to orders using their email addresses. If the store doesn’t have a customer with an email it is tied to, the imported order will still have customer details. However, such customers will be listed as guests.
  4. Both Magento 2 Community (Open Source) and Enterprise (Commerce) edition order tables can be imported into each other. Magento 2 Commerce has gift card and reward point attributes, however, Magento 2 Open Source ignores them, so you can import Commerce orders into Magento Open Source without any issues.

Improved Import and Export extension allows to both export orders from Magento 2 and import orders. If you want to transfer the order history from one Magento 2 instance to another read Improved Import and Export extension manual.

Generate invoice and shipment on import of tracking number

Magento 2 Improved Import and Export also allows filling any gaps in order shipment and invoicing data by importing shipment tracking numbers. The functionality introduces automatical shipment and invoice generation upon transferring tracking numbers to the store database. By enabling the corresponding options during import, you can significantly reduce the number of steps involved in the manual shipment and invoice management.

 

autogen

  1. The logic behind the Magento 2 tracking code import is strictly connected to product SKUs and item quantity.
  2. The shipment_track:track_number, shipment_track:title, and shipment_track:carrier_code attributes are crucial shipping data that must be specified.
  3. As far as order info is concerned, you’ll need only the increment_id attribute for the functionality to retrieve the necessary data.
  4. You can send email notifications to your customer every time a new tracking number is implemented into the database. Enable the ‘Send email from new tracks‘ to inform your customers about shipped orders.

To get to know the tracking code import explore the procedure details by visiting the Guide on how to import tracking numbers to Magento 2.

Get the sample tracking info import file at the Master Google Sheets Table.

Export Orders

The order export specifics revolve around a large number of entities that are included in any order. During export, you must decide what entities you need in your export file and keep in mind that some of them not be compatible with each other. The ‘Order Entities‘ is an extra filtering functionality unique for orders export.

The list of supported order entities for export you can find below:

  • Order;
  • Items of Order;
  • Products of Order;
  • Addresses;
  • Payments;
  • Payment Transactions;
  • Shipments;
  • Item of Shipment;
  • Comment of Shipment;
  • Tracks of Shipment;
  • Invoices;
  • Item of Invoice;
  • Comment of Invoice;
  • Credit Memos;
  • Items of Credit Memo;
  • Comment of Credit Memos;
  • Status History;
  • Tax;
  • Tax Items.

Let’s see the order export process with the ‘Product of Order Entity‘.

First and foremost, you need to select ‘Orders‘ as an entity for export. Then you can configure other settings related to manual or automatic export, consecutive export, etc. See more details on improved export in the Improved Import and Export manual.

order entity

If you need to export product data related to your orders, you export them with selecting the ‘Products of Order‘ entity.

products of order

If the entity box is checked during the export you get the file with all the order product attributes existing in your store. The list of such attributes you can find in the attributes.txt file. Keep in mind that you can not import such attributes back to your database.

All in all, such an export strategy is similar to the ‘Items of Order‘ export (which is normally the standard product info export), except for the change in the attribute names (‘item‘ prefix transforms into ‘product‘) and the wider range of the attribute data you can get in your export file.

Then you proceed with selecting the export data source and file format, mapping, and additional filtering.

Other import extension features

If the aforementioned features are not enough for importing orders to Magento 2 in your particular case, we have a trump card. The Improved Import & Export extension supports orders import to Magento 2 via REST API. It connects to the REST API of the specified platform, gets all the necessary information, and moves it to the appropriate backend section of your store. Everything works seamlessly and with the minimum external interaction.

You cannot find a tool that supports a more extensive range of file formats. Therefore, the Improved Import & Export Magento 2 extension provides the highest possible connectivity in the whole ecosystem allowing you to import orders from every external system without any headaches. But what about issues caused by different standards applied to data files?

The Improved Import & Export Magento 2 extension allows you to prevent them due to the extensive mapping interface. Since every system has its attribute standards, you cannot import the external order file to Magento 2 without matching the third-party order attributes to the corresponding internal attributes of your e-commerce store.

Luckily, the Improved Import & Export Magento 2 module allows creating a mapping scheme right in the backend so that you don’t need to edit data files manually. It is especially useful in case of the Magento 2 marketplace synchronization that provides order data files on a regular basis. Instead of matching attributes of the external platform to default order attributes of Magento 2 before every import, you create a mapping scheme only once. Next, the module applies it automatically when you import orders to Magento 2.

Attribute mapping

Another vital aspect of orders import to Magento 2 with the Improved Import & Export extension is the ability to automate data updates. In case you are synchronizing Magento 2 with an external marketplace, this feature will help you save a plethora of time. Create any custom schedule for Magento 2 orders import using the standard cron syntax. Alternatively, you can select a predefined interval. Note that the selected range can be customized according to your business needs.

Thus, the Improved Import & Export extension enables you to create a new import profile that transfer orders to Magento 2 automatically matching external order attributes to native requirements without external help. In case of one-time data migration, you can create a profile that can be launched only manually and still use the extensive mapping interface.

Also, note that the Improved Import & Export Magento 2 extension provides the ability to apply mapping presets. Being predefined mapping schemes, they essentially simplify the order import process since you can match all external order attributes to internal Magento 2 rules in just a few clicks. Our team is working hard to create as many presets as possible, but we recommend you to contact support regarding the mapping schemes you need. 

As you can see, the Improved Import & Export extension provides a broad variety of file formats suitable for data transfers, support REST API connections, and allows automating every order import to Magento 2. It is the most user-friendly and fully-featured tool to import orders to your e-commerce store. Check the following video to discover other features of the extension:

To find more information about the Improved Import & Export Magento 2 extension, follow the link below. Contact our support team regarding any inquiries related to the order import functionality of the module and other extension’s features.

Get Improved Import & Export Magento 2 Extension

'