How to Create a Custom Import in Magento 2

magento 2 custom import

Although the default import and export instruments of Magento 2 are enough to satisfy the basic data transfer needs, you may require some extra features to follow specific business demands. Sometimes the missing functionalities are available with third-party extensions but even the most robust modules often fail to deliver custom opportunities that satisfy particular business requirements. What’s to be done? 

Below, we shed light on how to create a custom import in Magento 2. You will find two different approaches to the Magento 2 custom import. Firstly, we discuss a community-provided solution that requires technical skills and coding experience. It is not for every user, especially those who don’t belong to the group of tech-savvy Magento 2 managers. Secondly, we provide a more friendly way of creating a custom import in Magento 2. It is based on the Improved Import & Export extension and involves no coding on the side of the extension’s end user. Before we proceed, check more useful tips here: Magento 2 Cookbook

The Magento 2 Custom Import Problem

PauGNU started a topic on StackExchange, where he asked about possible ways of creating a custom Magento 2 import. The author speaks about the Dataflow model of Magento 2 as an example of the custom import implementation. 

However, nothing similar is available in Magento 2. The new platform version lacks  ‘advanced profiles’ so that you cannot add custom entities to the import section. What do other community members recommend? 

DIY Custom Magento 2 Import

If you have enough skills and experience, it is possible to create a DIY import solution for magento 2, applying all the necessary customizations. But the more complicated your requirements are, the more work should be done.

Franck Garnier proposes to create a custom import with Magento 2. As follows: leverage the CatalogImportExport or CustomerImportExport module based on the ImportExport Magento module. Use the latter as a reference and follow these steps:

  • First of all, you have to create your own CustomImportExport module.
  • Next, it is necessary to add an import.xml configuration file. Follow these additional steps:
    • Add your entity model and behavior;
    • Add your entity type;
    • Add relatedInxexer to refresh data after import.
  • Now, you can implement a custom Magento 2 import model with your logic.

That’s it! The author also provides the following code examples. Perhaps, they will make the answer more evident.

Use the following code for import.xml: 

Look for the behavior module here:

Here is the product import model example:

These tips should be helpful if you are an experienced coder. However, qualified programmers may already know how to create a custom import in Magento 2. So, if you still have a zero understanding of how to achieve your business goal, proceed to the next chapter of this article. 

Magento 2 Custom Import for Everyone

Unfortunately, the default import/export solution of Magento 2 is minimal. It prevents you from transferring data using different file standards. You cannot automate transfers. An error message displays if a data file contains unsupported attributes or values. As for particular business cases and custom import implementations, they are very problematic. However, you can utilize the Improved Import & Export Magento 2 extension to create a custom import profile in Magento 2. The module offers enough features to complete even the most complex data transfers. 

It offers the following benefits over the native import:

  • We’ve fixed all common import issues related to the default tool. Or extension doesn’t have them.
  • Speed. Our module can import even large files very vast. The data is split into bunches, so the module uses less resources.
  • Magento 2 entities. While the default tools let you import only a few entities, our solution covers not only products and customers but also orders, categories, B2B, MSI, etc.
  • Support for multiple file types. Our module is not limited to CSV. It supports a bunch of other formats. 
  • Alternative data transfers. In addition to files, you can import data from Google Sheets and via API.
  • Different file sources. At the same time, it is possible to import data files from Dropbox, FTP, and SFTP.
  • Frequent improvements. We provide several updates with 20+ changelog items per year.
  • Attribute mapping. Your custom attribute naming will no longer prevent import p[rocesses. Furthermore, you can make third-party data files compatible with Magento 2.
  • Filters. The extension lets you export only relevant data that your partners need.
  • Backend + CLI. You can either rely on a user-friendly admin interface or use dedicated CLI commands.
  • You can find everything about the Improved Import & Export extension in the explicit documentation. 

When it comes to the competitors, our module is better due to the following facts:

  • One-time purchase. You buy Improved Import & Export only once. We don’t use SAAS, recurring payments, or IPAAS models.
  • Open code. You can freely create a custom Magento 2 import solution based on our module. Adjust the extension to fit your business needs.
  • Data control. Since the extension is installed on your Magento 2, you can fully control all data flows it creates. We use no cloud options.
  • Different use-cases. Often, there is no need to implement a custom import in Magento 2 due to the arsenal of features our extension provides. It covers numerous use cases from migration to warehouse management.
  • Support period. By purchasing our plugin, you also get a support period in which we consult, assist, and do small customizations.
  • Entities. Improved Import & Export works with all basic Magento 2 entities.
  • APIs. We use APIs to connect your e-commerce website with any CRM, ERP, PIM, and other external systems.
  • No conflicts. We built our module with native and third-party software in mind so that you won’t face any conflicts.
  • Best coding practices. With top Magento 2 specialists, we are on the verge of technology.

If the basic functionality of Improved Import & Export is not enough to satisfy your business requirements, we offer the following services and customizations:

  • Migration from Magento 1 to Magento 2.
  • Migration from Shopify, Bigcommerce, Prestashop, and Wocommerce to Magento 2.
  • Setup and customization of dropshipping and multi-channel sales models.
  • Synchronization with CRM, ERP, and PIM systems via REST/SOAP APIs.
  • Assistance with exporting custom Magento 2 feeds.
  • XSLT templates for XML files.
  • Other extension customization services

Contact Us to discuss your business needs. Chances are, you don’t need to create a custom Magento 2 import with our extension since the Improved Import & Export extension already offers the functionality you are looking for. If it still lacks the features you need, we can implement them.

Let’s explore the basic functionality of our extension to provide you with a better understanding of its possibilities.

Improved Import & Export Features

The Improved Import & Export Magento 2 extension lets you automate data transfers. You no longer need a custom import solution to move data files automatically. The module enables you to create cron-based schedules or use triggers to launch import/export processes. You only need to choose a predefined value or create a custom interval to make everything work. The configuration looks as follows: 

magento 2 custom import automation

As mentioned above, mapping is another feature that can replace the Magento 2 custom import. While the default tools don’t let you replace third-party or custom attributes in the backend, the Improved Import & Export enables you to apply mapping presets. Next, the plugin replaces all third-party attributes with ones used internally in a fully automated manner. Your role in this process is reduced to a few clicks, as shown below:

magento 2 custom import preset

Alternatively, Improved Import & Export offers an interface where you can match all third-party and custom attributes to ones used internally. The procedure is straightforward and intuitive. You select a third-party attribute and specify a replacement. 

It is also possible to map and edit attribute values and third-party categories. If you are looking for a custom import solution for Magento 2 to implement this functionality, choose our module. In addition to that, the module enables you to create attributes on the fly. The module generates the missing data using the provided parameters.

You can freely import/export the following entities:

  • Products;
  • Categories;
  • Customers and Addresses;
  • Advanced Pricing;
  • Product Attributes;
  • Orders;
  • CMS Pages;
  • CMS Blocks;
  • Catalog & Cart Rules;
  • Gift Cards;
  • Reviews;
  • URL Rewrites;
  • Search Terms and Synonyms;
  • Widgets;
  • Page Hierarchy.

Note that we are going to add more entities within further extension updates.

As for file formats, our extension lets you transfer data via CSV, XML, Json, XLSX, ODS, and ZIP & TAR. Thus, you no longer need a custom Magento 2 import solution to transfer such files into your system. 

Improved Import & Export simplifies your daily routine by eliminating the necessity to convert tables to CSV. It is also possible to import any XML file to Magento 2 with the help of XSLT. As for the JSON support, it enables much more extensive opportunities than the default import tool, providing the ability to run REST API transfers.

With the support for Excel and OpenOffice, the extension can import XSL, XSLX, and ODS tables. You don’t need to convert them to CSV. Also, note that the Improved Import & Export Magento 2 extension eliminates the necessity to extract data files from an archive before importing them to Magento 2.

You can transfer data from the following sources:

  • REST and SOAP API;
  • Google Sheets;
  • Direct URL;
  • FTP/SFTP;
  • Dropbox;
  • Direct File Upload.

We are going to extend this list within the next updates. 

If the features described above are not enough, you can extend the functionality of our module with the help of the following add-ons:

  • MSI Add-on lets you transfer entities added to Magento 2.3 with the official Multi-Source Inventory extension. You don’t need a custom Magento 2 import solution to import and export such data as warehouses and product quantity per warehouse with this add-on.
  • With B2B Add-on, you can freely transfer entities added to Magento Commerce (Cloud) with an official B2B extension. Our solution lets you import and export companies, shared catalogs, quotes, negotiable quotes, and requisition lists.
  • WooCommerce Migration Add-on is responsible for the migration from WordPress to Magento 2. No custom import solution for Magento 2 is necessary to transfer data from your old website to a brand-new one. 
  • As for the MS Dynamics Integration Add-on, it enables the Magento 2 MS Dynamics Business Central ERP/CRM integration. You can synchronize products, orders, customers, shipping, and invoices between the two systems with its help.
  • You get the same opportunities with the NetSuite Integration Add-on. No custom import tool is necessary.
  • With Banggood Dropshipping Add-on, you can start a dropshipping business based on our favorite e-commerce platform. The add-on provides the ability to connect your e-commerce store with Banggood with no customizations. Next, you can synchronize products, orders, and shipping details between the two platforms.

All add-ons are available here: Magento 2 Extensions by Firebear.

Magento 2 Custom Import FAQ

How do we import custom or third-party entities to Magento 2?

You can easily transfer any custom or third-party entity to Magento 2 with the help of Improved Import & Export since the extension lets you map their attributes to ones available in your admin. Consequently, you freely transfer products, customers, or orders from external platforms without modifying them manually in a data file. Note that the Improved Import & Export extension lets you transfer all the core entities of Magento 2, including ones related to its B2B module.

How do we import data files of unsupported formats to Magento 2?

First of all, you may try to convert unsupported data files to CSV and then import them to Magento 2. However, it is usually a time-consuming routine especially if you have to deal with numerous files. As for the Improved Import & Export module, it provides the ability to transfer data via CSV, XML, XLSX, JSON, and ODS. Besides, you can import files of these types in TAP or ZIP archives.

How do we establish a custom import connection via API?

The Improved Import & Export Magento 2 module transfers data via APIs. Specify API as your import source and provide connection parameters to run the integration.

What customizations are necessary to import data from Dropbox?

With Improved Import & Export, you don’t need customizations to import data from Dropbox. Besides, the extension lets you transfer data files from Google Drive, FTP/SFTV, or a file URL. Alternatively, you can provide them straight from the upload window.

Is it possible to customize export processes to filter out the data you transfer from Magento 2?

There is no need to apply any complex customizations to enable fully-featured filters in Magento 2. You can get the missing functionality with Improved Import & Export. At the same time, it is possible to customize the feature to make it more suitable for your unique business requirements.

How can I customize Improved Import & Export?

Since the extension has open code, you can freely apply any changes. At the same time, you can discuss customizations with our specialists. We can implement any changes to the module’s functionality to make it more suitable for your business requirements. However, most of our customers don’t need to implement custom import enhancements due to the arsenal of features our extension provides. The tool covers numerous use cases from migration to warehouse management. We provide synchronization with CRM, ERP, and PIM systems via REST/SOAP APIs as well as migration from Magento 1, Shopify, Bigcommerce, Prestashop, and WooCommerce to Magento 2. Besides, we offer setup and customization of dropshipping and multi-channel sales models and assistance with exporting custom Magento 2 feeds.

What is the possibility of conflicts between my custom solution and other Magento modules?

Since we develop our data transfer solution with native and third-party software in mind, you won’t face any conflicts. Due to the best coding practices implemented by the top Magento 2 specialists, we stay on the verge of technology. Furthermore, the Improved Import & Export extension is available on the Magento Marketplace – a seal of excellence for Magento plugins.

Final Words

As you can see, there are numerous ways to implement a custom import in Magento 2. You can either create it from scratch, customize the existing solution, or ask a third party to deliver a tool that suits your needs. Improved Import & Export is a potent instrument designed to transfer data between your Magento 2 website and any external system. If your business case requires additional improvements, contact us to discuss what exact features should be implemented. Keep in mind, that our extension is also suitable for the Adobe Commerce custom import! For further information, follow the link below:

Get Improved Import & Export Magento 2 Extension