How To Export & Import Magento 2 Orders

- E-Commerce, Magento 2, Our extensions

import orders into magento

The following article sheds light on the Magento 2 import of orders. Merchants usually do that when they migrate to Magento 2 or synchronize their business with external marketplaces. However, in Magento 2, the import of orders is impossible by default. You cannot do that with the built-in tools, but a third-party extension, such as Improved Import & Export, can add the missing functionality to the admin interface. 

Below, we explain how to import orders into Magento despite the native limitations of the platform. You will learn what order file structure is required for this process and how to import a table with order data to Magento 2. Besides, we explain how to generate invoices and shipments while importing order tracking numbers to Magento 2. 

The blog post also explains how to export orders from Magento 2. This procedure comes in handy in similar cases: when the migration from Magento 2 is required or orders are processed in external systems. Unlike the Magento 2 order import, the corresponding export process is available in the administration right on the order page. Although the Magento 2 export of orders is possible with the default tools, we describe a more fully-featured but at the same time natural way of doing that. 

The final chapter of the article reveals other features of the tool that we use to run data transfers. So, let’s dive deep into the Magento export-import of orders.

 

Magento 2 Import of Orders Step-By-Step Guide

Below, we explore the Magento 2 order import divided into several important stages. First of all, we guide you to the tool that adds the missing order import functionality to Magento 2. Next, we explore attributes required for the Magento 2 import of orders. After that, you will learn the actual order import procedure along with several important features.

Step 1. Get Your Magento 2 Order Importer

Since Magento 2 doesn’t let you import orders, you need to install the Improved Import & Export extension. In addition to the enhanced order import functionality, the module also adds automation, mapping, and support for various file formats and sources. We focus on these aspects in the last chapter of this article. Follow this link to get your Magento 2 order importer:

 Get Improved Import & Export Magento 2 Extension

Step 2. Create a Magento 2 Order Import CSV

You can use the default order export functionality to get a sample file that illustrates how order attributes look in either CSV or XML. This approach, however, is associated with a couple of inconveniences. First of all, your exporter data may lack some values, so you won’t be able to fully explore such CSVs. Another less obvious disadvantage is the lack of column descriptions. Although no exporter can create a Magento 2 order import CSV with column descriptions, you can always get a sample table that contains not only all values but also explanations of what’s going on in each column, in our Google Sheets Master Table:

Visit the Master Google Sheets Table for a Magento 2 Order Import Sample File

We use a standard CSV format for our sample files. Let’s have a look at the order CSV table and 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 Magento 2 import of orders.

Magento import orders: CSV

The list of order attributes is relatively extensive, however, to perform a successful import you can go with just the required ones. Therefore, you can choose whether to import a full set of attributes or perform the Magento import of orders with a minimum selection of the required data. Both options are available in our Master Google Sheets Table:

From the sample above, you can see that the orders are exported from the database preserving all attributes and values from the DB.

When importing orders one needs to remember the following four aspects:

  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.
    Magento import orders: entity id and increment id
  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. Magento 2 Open Source and Adobe Commerce order tables are similar. The only exception is that 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 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 the Improved Import and Export extension manual.

Step 3. Import Orders to Magento 2

When you are done with the table proceed to System > Import, or System > Import Jobs and follow these steps to import orders to Magento 2:

  1. Enable your new job, name it, and use a corn schedule to automate regular transfers;
    Magento 2 import orders: automation
  2. Select import entity ‘Orders’;
    Magento 2 import orders: select entity
  3. Choose your import behavior and configure separators if necessary;
    Magento 2 import orders: import behavior
  4. Upload the composed CSV table or copy the Google Sheets link to import orders to Magento 2;
    Magento 2 import orders: import source
  5. Press the Validate file button to check whether your “Magento 2 import orders” CSV is composed correctly;
  6. Hit the Import button followed by Run.
    Magento 2 import orders: import run

The Improved Import & Export extension will import orders to Magento 2. However, it is a basic way to transfer order data to your website. Our module offers a couple of other useful order import functionalities.

How to generate invoices and shipments during the import of tracking numbers in Magento 2

The Improved Import and Export extension also allows for filling any gaps in order shipment and invoicing data by importing shipment tracking numbers to Magento 2. The functionality introduces automatic 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 manual shipment and invoice management.

 

Magento 2 import orders: generate shipments and invoices

  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.

How to generate order IDs automatically during Magento 2 order import

When Improved Import & Export is used to import orders from a drop-ship vendor it means that they don’t have a Magento order increment or entity ID. However, the extension can automatically generate them during the Magento 2 import of orders, just as if they are created from the Magento admin panel.

There is a possibility to generate orders’ increment IDs when:

  1. The column increment_id is in the import file but is empty;
  2. The column increment_id is missing in the import file.

You can enable this feature in the job’s Import Settings. After selecting Orders as your Magento import entity, you will see the ‘Use auto-increment for order increment_id’ toggle. Turn it on to automatically generate increment IDs if they are missing during the Magento 2 order import:

Magento 2 import orders: generate increment ids

Magento 2 Export of Orders Step-By-Step Guide

Although you can use the standard order export functionality of Magento 2, we won’t focus on it. You can find the corresponding functionality under Admin -> Sales -> Orders. Just Hit the Export menu and then the Export button.

Magento 2 Export of Orders standard functionality

Now, pick the exported Magento 2 orders in your folder with Downloads. That’s it. But how about a more flexible and feature-rich approach to the Magento export of orders?

With the Improved Import & Export extension, you can apply multiple useful features to the order export output. Let’s see what advantages our module brings into the game:

  1. Proceed to System > Improved Import/Export > Export jobs and click the ‘Add New Job’ button to create a new Magento 2 order export job.
    Magento 2 Export of Orders: add new job
  2.  In the General Settings, specify the job name and set the job schedule to export orders from Magento 2 automatically.
    Magento 2 Export of Orders: automation
  3.  Below the General Settings, you will find Export settings. 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.
    You can also set up a Consecutive Export – if it is enabled and the export job is set to run automatically, every consecutive execution of the job will export NEW orders, that have been created in Magento 2 since the last execution of the job.
    Magento 2 Export of Orders: entity
  4. In the Export Behavior, you decide on the file format you want to export the data into and set the export file separator values. Another important feature is Order Entities. We will return to it soon.
    Magento 2 Export of Orders: choose file format
  5. In the Export Source configuration section, you select the export source for your Magento 2 export of orders: File, Google Sheets, Dropbox, FTP, URL, etc. Also, it is possible to specify the path to the file where the data should be exported. The files are created automatically and can be downloaded right from the export job screen after the export is complete.
    Magento 2 Export of Orders: choose export source
  6. Also, you may need to map attributes and apply additional filters to modify Magento’s order export output.  Proceed to the Improved Import and Export Extension Manual to find the description of these processes. Since they are not mandatory for order export, we don’t focus on them in this guide.
  7. Finish the configuration and run the export process.

Advanced Magento Export Filtering With The Order Entities Feature

Since Magento 2 order export specifics revolve around a large number of entities that are included in any order, our extension lets you decide what entities you need in your export file. The ‘Order Entities‘ is an extra filtering functionality unique for order export.

The list of supported order entities includes the following items:

  • 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‘.

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

Magento 2 Export of Orders: order entities feature

If the entity box is checked during the export you get the file with all the order product attributes from your store. However, 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 (the ‘item‘ prefix transforms into ‘product‘) and the wider range of the attribute data you can get in your export file.

You must admit that this procedure is way more flexible than the standard Magento 2 order export. Let’s see what other useful features the Improved Import & Export extension offers.

Other Useful Features for Magento’s Export-Import of Orders

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 an order 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 to Magento 2 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 external orders 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 the case of the Magento 2 marketplace synchronization which provides order data files regularly. 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.

magento export import orders: import mapping

Another vital aspect of the Magento 2 import of orders 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 transfers orders to Magento 2 automatically matching external order attributes to native requirements without external help. In the case of one-time data migration, you can create a profile that can be launched only manually and still use the extensive mapping interface.

magento export import orders: automation

Also, note that the Improved Import & Export Magento 2 extension provides the ability to apply mapping presets. Predefined mapping schemes simplify the Magento 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 contact support regarding the mapping schemes you need. 

As you can see, the Improved Import & Export extension provides various file formats suitable for data transfers, supports REST API connections, and automates 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:

For 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 features.

Get Improved Import & Export Magento 2 Extension

Order import/export FAQ

How to export orders from Magento 2?

If you want to export a list of sales orders from Magento, you can use its default functionality. Go to Sales -> Orders of your administration and hit the Export button. Alternatively, you can export orders from Magento 2 using the procedure described in this article.

How to add the quantity ordered to export in Magento 2?

You need the Improved Import & Export extension to transfer all the order data from Magento 2. Use the procedure described above.

How to import orders to Magento 2?

As we’ve already mentioned above, you cannot import orders to Magento 2 with the help of the platform’s default tool. Therefore, you need a third-party extension to transfer order data to your e-commerce storefront. Use the Improved Import & Export Magento 2 extension described above.

How to import orders from Magento into Shopify?

You can easily import orders from Magento 2 to Shopify or any external platform following this algorithm:

  • Export orders from Magento 2
  • Edit the exported file following the requirements of Shopify or the system you want to move it to. You may need to change a file format as well as set new column names.
  • Import orders to Shopify or the system you want to move it to.

That’s it! However, it is possible to simplify order transfer between Magento 2 and external platforms with the help of third-party extensions. For instance, you can use the Improved Import & Export Magento 2 module to export orders from the first system and rely on the Improved Import & Export for Shopify to move them to the second one.

It is possible to apply a similar approach when importing purchase orders from Magento into Quickbooks or other accounting services, CRM systems, or ERP platforms.

How to import and export orders in Magento 2 automatically?

You need to use the Improved Import & Export extension to transfer orders to/from Magento 2 automatically. The module lets you create cron jobs that import and export order data at a specified point in time.

How to use API to import and export orders in Magento 2?

The Improved Import & Export Magento 2 extension also lets you use API transfers to move orders to/from the system. You can create a seamless connection between your e-commerce website and an external platform transferring information between them without any additional exchange points.

How to implement Magento 2 import of orders from Google Sheets?

Improved Import & Export also comes in handy when you need to import orders from Google Sheets. We’ve described this procedure above.

How to import and export orders in Magento 2 via XLSX?

You need the Improved Import & Export extension to import orders in XLSX and XLS formats. The extension lets you export orders using both standards. Our module also works with CSV, XML, ODS, and JSON.

How to run Magento 2 import of orders in file archives?

Since Improved Import & Export works with ZIP & TAR formats, you can import compressed data files with the help of the extension. The module will unpack them automatically.

How to retrieve targeted data from your database or import files while transferring orders?

With the Improved Import & Export module, you get the ability to run full or partial Magento 2 order import and export. It means that you can retrieve targeted data from your database or import files or transfer all orders in one go.

How to generate shipments upon order tracking code import and export?

The Improved Import & Export module lets you generate shipments automatically when you import or export Magento 2 order tracking codes. Furthermore, you will stay informed on each track created in the store due to email notifications. Now, you can import and export Magento 2 tracks of shipments and generate shipments and invoices upon a job run.

How to schedule Magento 2 import-export or orders?

As we’ve already mentioned above, you can leverage cron jobs to run automatic import and export. Furthermore, it is possible to get the most out of order export with Magento 2 events: Improved Import & Export can launch data transfers when specific conditions are met.

What are the supported Magento 2 order import and export sources?

The Improved Import & Export extension lets you leverage the following data sources for Magento 2 order transfers: REST and SOAP API, FTP/SFTP, Dropbox, Google Drive, Google Sheets, URL, file upload, etc. As for the default Magento’s capabilities, they are fairly limited.

How to deal with external data standards while importing orders?

With the Improved Import & Export extension, you get the ability to leverage a powerful mapping interface. The module’s Magento 2 order attribute mapping lets you control your import and export job runs with powerful mapping functionality. It enables you to manage both massive data updates and single modifications of attributes and attribute values.

Final Words

The Magento 2 import of orders is an important data transfer that lets you connect your e-commerce website with external storefronts, marketplaces, and tools. although it is not available by default, you can easily get the missing Magento order import functionality with the Improved Import & Export Magento 2 extension. It not only supports plain data transfers but also adds numerous features that automate the creation of shipping and invoices and auto-generate order IDs.

When it comes to the export side of the process, Magento 2 offers a built-in order exporter. However, it lacks features. You can only transfer all orders out of your website. With the Improved Import & Export extension, it is possible to narrow down the selection of exported records by enabling consecutive export. Thus, you export only the latest orders created after the last export run. In addition, multiple filtering options and mapping features are at your service when it comes to the Magento 2 export of orders with our extension. Follow this link for more information:

Get Improved Import & Export Magento 2 Extension