How to Import Products with Custom Attributes to Magento 2

- E-Commerce, Magento 2

Magento 2 import export debug log

When you import products to Magento 2, you may face various difficulties. If all items are suitable for the Magento 2 requirements, it is possible to transfer them to your website with no headaches. However, when custom product attributes enter the game, merchants usually experience difficulties. 

In the following article, we provide several tips on how to import products with custom attributes to Magento 2. Below, you will find various recommendations on how to streamline this process. First of all, we shed light upon how to enable the Magento 2 product import if you have to deal with custom attributes, avoiding the most common errors. After that, you will find a short guide on how to automate the procedure. Next, the article touches upon the topic of missing attributes. We explain how to create them on the fly automatically. And of course, products bound to third-party categories are also a topic of our discussion. We describe how to match them to the ones you use in your e-commerce catalog. More useful tips are available here: Developer’s Cookbook.

'

Import Products with Custom Attributes to Magento 2 without Errors

You can import products with custom attributes to Magento 2, applying the same algorithm as the one you use with products that incorporate default attributes. But there is a notable exception that we’ve discovered in this discussion on StackExchange. While you can use absolutely the same mechanisms and tools, you should keep in mind that some custom attributes may lead to errors, disrupting data transfers. 

Ankit Shah detailly described his import case here. The author of the discussion exported a file with product data and wanted to reimport it back. However, the system displayed the following error: 

Value for ‘product_type’ attribute contains incorrect value

And to make the long story short, we won’t rewrite all the conditions the author faced since they don’t make any difference from the perspective of our guide. The only thing we want to draw your attention to is the cause of the problem. 

A custom product attribute became a reason for the failed import. The author used a custom attribute called Product Type. As you might have guessed, its code was ‘product_type,’ which is also utilized by the same default attribute. As a result, Magento 2 recognized the custom attribute as a system one and applied the corresponding requirements to its values. However, the custom attribute utilized values that were not supported by default, causing the error.

To solve this problem, the author had to rename the custom attribute. After that, the issue was fixed, so Ankit freely imported products with custom attributes to Magento 2. 

If you don’t want to get into the same situation, we recommend you to avoid reserved words when you create custom attributes in Magento 2. In other words, don’t use names that are already utilized by the system. You can see all default product attributes and their values here: Magento 2 Product Attribute Reference. Learn them before importing products with custom attributes to Magento 2.

Import Products with Custom Attributes to Magento 2 Automatically

A general product import workflow in Magento 2 looks as follows:

  1. You go to the Magento 2 admin, System, Import.
  2. Select “Products” from the “Entity Type” dropdown. 
  3. Select an import behavior option.
  4. Check the data and upload a CSV file. 

While it is intuitive and straightforward, you cannot automate the process. It is necessary to repeat the same actions every time you want to import products with custom attributes to Magento 2. Use the Improved Import & Export Magento 2 extension to automate the procedure. While it offers a similar general workflow, our module also provides the ability to use schedules to transfer all types of products with custom attributes automatically. 

The extension utilizes cron to power the feature. You can create custom intervals or select predefined ones. At the same time, profiles with no schedule are still an option. And you can launch import whenever you want using asynchronous updates. The schedule configuration looks as follows:

Magento 2 CMS Blocks

Import Products with Third-Party & Custom Attributes to Magento 2

If your product data file contains not only custom attributes but also third-party system ones, you cannot import it using the default Magento 2 tools. However, the Improved Import & Export Magento 2 extension comes in handy again. The module offers mapping presets that modify third-party data according to the rules of Magento 2. You only need to select a predefined scheme suitable for your integration to let our plugin replace all external attributes with ones used internally. As for custom attributes, they stay untouched, while the Improved Import & Export plugin modifies a custom data file, making it suitable for import. The process looks as follows:

You can use the following add-ons to import products with custom attributes to Magento 2 modifying the corresponding third-party values:

  • WooCommerce Migration Add-on lets you seamlessly migrate from WordPress to Magento 2, transferring all the necessary product data. No programming skills are required to import WooCommerce products, customers, addresses, and orders.
  • MS Dynamics Integration Add-on provides the ability to connect Magento 2 to MS Dynamics Business Central ERP/CRM and synchronize product data between them.
  • Banggood Dropshipping Add-on introduces the easiest ways to start a dropshipping business with Magento 2. With this tool, you can connect your e-commerce store to the Banggood catalog and transfer product data to Magento 2.

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

Alternatively, it is possible to use an interface where you can prepare products with both custom and third-party attributes manually. Just choose an external system attribute and specify a replacement. You can apply similar actions to product attribute values. With Improved Import & Export, it is no longer a problem to map and edit them in bulk.  

Import Products with Custom Attributes and Third-Party Categories to Magento 2

Another mapping feature that lets you import products with custom attributes to Magento 2 is related to categories. When you transfer data from third-party systems, the module enables you to replace external category names with ones utilized internally. The process looks as follows:

And you can generate new on the fly. Choose a parent category first and then specify a new one. Next, the extension will connect products to this category. Check the following article for further information: Category Mapping.

Import Products with Custom Attributes to Magento 2 When Some Attributes Are Not Available

If your data file lacks some attributes, you can freely transfer it into the system using the Improved Import & Export Magento 2 extension. The module enables you to create attributes on the fly. So if a file with custom product attributes lacks some system ones, it is no longer a problem. You can specify the parameters necessary to generate the missing data automatically. The feature is described here: Product attributes import.

Import Products with Custom Attributes to Magento 2 in Different Formats

While Magento 2 lets you import data as CSV files only, the Improved Import & Export extension dramatically extends the default functionality. In addition to CSV, the module supports XML, Json, XLSX, ODS, and ZIP & TAR. It means that there is no need to convert files to CSV. Furthermore, the extension lets you import any XML file to Magento 2 based on XSLT instructions.

As for Json, this feature enables Rest API transfers and opens further opportunities than the default import tool offers. And the ability to import Excel and OpenOffice formats to Magento 2 lets you transfer them via XSL, XSLX, and ODS tables. 

Furthermore, you can import products with custom attributes in supported file formats even when they are compressed. With the extension supports ZIP & TAR archives and can unpack them automatically. You can transfer the information from the following sources:

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

In addition to ALL product types, Improved Import & Export lets you transfer the following entities:

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

We are going to add more entities withing further updates.

Final Words

Custom attributes are no longer a problem if you know how to name them correctly. Don’t use the system attribute values to specify your custom ones to avoid import errors. If you want to go further with the data transfer simplification, use the Improved Import & Export Magento 2 extension. Our module lets you automate import processes moving all data whenever you specify. Besides, it provides the ability to replace third-party attributes and unsupported values when you import products with custom attributes to Magento 2. And you can freely restore the missing data due to the ability to create attributes on the fly. At the same time, Improved Import & Export lets you import products with attribute values using various file formats and sources so that you are no longer limited to CSV and file uploads. For further information, follow the link below:

Get Improved Import & Export Magento 2 Extension

Magento 2 Product Import FAQ

If you still have questions regarding importing products with custom attributes, pay attention to the following Q&A sections.

How to import products with custom attributes to Magento 2 via API?

By default, Magento 2 neither lets you import products with custom attributes nor transfer other entities via APIs. But you can get the desired functionality with the Improved Import & Export extension. It lets you transfer products with custom attributes to Magento 2 via API. The module lets you create the connection between the two systems moving the corresponding data.

How to import products with custom attributes to Magento 2 via ODS files?

If your products with custom attributes are stored in an ODS file, say no more! The Improved Import & Export Magento 2 extension will help you to transfer them to your e-commerce website. While Magento 2 works with CSV files only, our module exceeds the existing barriers by adding support for other file formats.

How to import products with custom attributes to Magento 2 via XLSX files?

If your products with custom attributes are stored in an XLSX file, say no more! The Improved Import & Export Magento 2 extension will help you to transfer them to your e-commerce website. While Magento 2 works with CSV files only, our module exceeds the existing barriers by adding support for other file formats.

How to import products with custom attributes to Magento 2 via JSON files?

If your products with custom attributes are stored in a JSON file, say no more! The Improved Import & Export Magento 2 extension will help you to transfer them to your e-commerce website. While Magento 2 works with CSV files only, our module exceeds the existing barriers by adding support for other file formats.

How to import products with custom attributes to Magento 2 in a compressed file?

If products with custom attributes are stored in a file archive, you can also transfer them to Magento 2 with the help of the Improved Import & Export extension. The module works with ZIP and TAR formats. Note that your archives should contain a CSV, XML, ODS, XLSX, or JSON file.

How to import products with custom attributes to Magento 2 from Google Sheets?

You can also use the Improved Import & Export extension to import products with custom attributes to Magento 2 from Google Sheets. You need to specify the corresponding table as your import source, providing its URL.

How to import products with custom attributes to Magento 2 from Dropbox?

In addition to Google Sheets, the Improved Import & Export module works with several cloud storages. Thus, it lets you transfer products with custom attributes to Magento 2 from Dropbox. Your data should be stored in a CSV, XML, ODS, XLSX, or JSON format. Note that files of these types can be compressed in a ZIP or TAR format.

How to import products with custom attributes to Magento 2 from Google Drive?

In addition to Google Sheets and Dropbox, you can leverage Google Drive to import products with custom attributes. The Improved Import & Export module lets you transfer files from this cloud storage. You have to deal with CSV, XML, ODS, XLSX, or JSON formats. If they are compressed, it should be a ZIP or TAR file.

How to use product import to mass update attributes in Magento 2?

According to various publications, you can mass update attributes in Magento 2 by importing products. However, we recommend you to use the Improved Import & Export extension for this purpose since it offers way more flexible settings for that. The extension lets you update product attributes in bulk, applying changes straight to the records that should be modified. You need to select attributes as your import entity and choose the add/update import job behavior.

How to import csv with several attributes to Magento?

As you’ve just seen in the article above, the Improved Import & Export module provides the ability to import a CSV file with several attributes to Magento 2. Also, you can leverage such file formats as XML, XLSX, ODS, and JSON. If your attributes are stored in Google Sheets, the extension can also move them into your e-commerce website. Alternatively, the plugin lets you generate an API connection to import any entity to Magento 2 from any external point.

How to import attribute values into Magento 2?

With the default Magento import tool, you can import neither attributes nor their values. As for the Improved Import & Export extension, it enables both functionalities. You can not only transfer attribute values to your Magento 2 installation but also map them to the existing records.

How to import yes/no attributes to Magento?

Since, the Improved Import & Export module lets you import attributes of all types, yes/no attributes are not an exception. You can find the yes/no attributes in the Magento 2 product attributes import table. Take a look at our Google Sheet Master Table to see their exact placement.

How to remove attribute values during Magento 2 product import?

The Improved Import & Export module lets you delete attribute values during the Magento 2 import by adding option:delete_values to your import file. In this column, you need to specify the attribute values you want to delete. The attribute itself stays unchanged. Practically, it works as follows: you specify values that have to be removed, for instance, green, red, and yellow for the attribute ‘color’.

How to export product attributes in Magento 2?

We’ve just described numerous nuances of product import processes in Magento 2, but what about exporting data? The Improved Import & Export extension lets you export products with custom attributes from Magento 2. Create a new export job, choose the corresponding export entity, and provide other parameters of your new transfer.

'