Default Magento 2 import tool allows you to add or update products, replace existing data and delete entities in bulk via CSV file upload.
Comparing to Magento 1.x, the database structure of Magento 2 based stores has been changed. Respectively, the list of required import fields used for Magento 2 import has also been altered.
This article allows to get a deeper understanding of the specific data structure necessary for successful CSV upload into Magento 2.
The basic file format used for data import is CSV (comma separated value). It is supported by basically all spreadsheet programs and database applications. CSV file is similar to Excel, and it is even simpler and easier to use.
CSV file needs to have a specific structure that matches the database structure when importing.
The first row of the file table should contain the names of the attribute columns. They need to correspond to the attribute codes of the database fields and should be specified in separate column. In order to ensure that the headlines of your CSV file are identical to database fields and will be recognized and accepted by Magento, you can export a few products to see format of column names.
When a CSV file exported from Magento is opened in a text editor (like Notepad), you can see that data fields are separated in most cases by comma (by default), text and other multi-part values are enclosed in double quotes.
If you edit CSV for later import into a Magento 2, it is strongly recommended to re-save the file with UTF-8 encoding.
This is necessary because some of spreadsheet programs add additional characters to the headers or cells that might result in data not being imported to Magento.
To save the file with correct encoding, you can use text editor like Notepad ++ or a spreadsheet program like OpenOffice Calc.
Magento 2 allows you to export the pre-formatted CSV data file, containing the relevant attributes and sample data. To get the file log in to your Magento 2 admin, go to System -> Import -> Entity type (products) -> Download sample file.
This sample file will provide you with a list of all available product attributes and the relations among goods. By default, there are 84 attributes in Magento 2 and the list can be enhanced with attributes that you can create by yourself. However, it does not mean that you need to fill in the info and use all of these attributes.
To keep things simple you can include in the file mandatory fields for Magento 2 import plus additional information fields you want to include for your products.
Let’s have a closer look at CSV file contents for Magento 2 import. Below, you can find a detailed description of columns necessary for upload of simple products without relations.
Magento 2 has changed the logics on how you format your custom product attributes in the import CSV file. Magento 1 used to allow a columnar approach, where you could do 1 column for each piece of information. In Magento 2 all the custom attributes you created are placed into one column - additional_attributes.
Format of additional attributes will be the following: attribute=value (for single-value attributes) and attribute=value1|value2|value3 (for multi-value attributes).
Numerous attributes belonging to one product are placed to one cell and separated by comma symbol.
For example: color=Red,gender=Men|Women|Unisex,size=6
Here you can find the list of fields set by default during Magento 2 import, in case you haven’t indicated values in file yourself. If necessary, you can include columns with values in your file to change particular details for imported products.
Enumerated columns are not obligatory for Magento 2 import, however, including them might be a good idea in case you would like to provide the buyers the necessary info on your goods.
For example, Default Category/Gear/Watches,Default Category/Women
This way, products will be assigned to ‘Watches’ and ‘Women’ categories after import.
Both, description and short description may include valid HTML tags.
Image-related fields, like:
- Columns without content are ignored during the import process.
- It is not possible to add attributes during the import process. Only existing attributes and their values can be imported.
- By default, there is a 20 MB limit for any file exported to and imported from Magento 2.
Full list of Magento 2 import fields you can check reading official user guide -
https://docs.magento.com/m2/ce/user_guide/system/data-attributes-product.htmlAfter import file has been prepared and all the columns with information are checked, you can proceed with upload itself. To do so, navigate to System-> Import section of your Magento admin.
There select entity type ‘Products’ and configure the following settings:
- Import Behavior - you can select one of the offered actions: add / update, replace existing complex data or delete entities.
- You can specify whether the import process should be stopped if errors occur, and in the Allowed Errors Count field, you can enter how many errors to display.
- Separators: the standard values, ie the comma (","), should normally not be changed. Only in case import file has different separators, these settings may be altered.
- File to import - select the prepared CSV spreadsheet saved at your local PC.
- Images file directory - should be indicated in case pictures were uploaded to other location, than it is recommended by default (/pub/media/import)
Before products are imported into Magento, they must go through the validation process to ensure that the data structure matches the database fields. Validation starts when the ‘Check Data’ button is clicked.
What is checked:
If the data are valid, ‘File is valid!’ notification appears.
If the validation fails, the error message notifies you on the field(s), where problems were detected, so you can check what should be corrected in your CSV file.
A few most common errors that might occur during import validation are described here along with possible solutions.
We can't find required columns: ....
Check if your file includes mentioned in the error column that is mandatory for Magento 2 import. Re-save the file with UTF-8 encoding.
Please make sure attribute "..." is not empty. in row(s): 1
Column value specified in file should not be empty and has to correspond to Magento requirements. Aso check file encoding.
Column names: "..." are invalid
Check column headers. They have to be exactly the same as Magento 2 database field names. Moreover, incorrect delimiters indicated during import may result in this problem.
As you can see from the bunch of text and explanation above, built-in Magento 2 importer has strict requirements to import file format, columns and fields included. So every time you get the file from your supplier and it does not fit Magento requirements, you have to adjust it manually.
If you are looking for easier and more enhanced Magento 2 import tool, check Store Manager for Magento. This application allows to import products from locally saved or remote (using direct URL or FTP link) files of different formats: CSV, TXT, XML, Excel, ODS. No strict requirements to import file format, due to fields mapping functionality included.
This multi-purpose application also offers the following features to improve Magento 2 import experience:
Thanks for reading! If you have questions or need more details on the topic, drop a comment below and we would try to find a solution for your particular case.
Reasons of missing products after Magento import and their solutions. Read More...
Detailed guide on Magento 2 category import withh CSV sample. Read More...
Check how to enable the possibility to import excel files to Magento 2 and avoid manual converting of excel file into CSV. Read More...
Images import CSV sample and instructions on import of images from externatl URLs or local server. Read More...
Hello, Pramod.
We recommend re-checking your import file, you can fall back upon export/import.
Also, maybe, you will find solution on Magento forum or Magento Stack Exchange site.
You can use Store Manager for Magento as well, as it does not have such strict requirements as the admin.
This website uses cookies.
Duplicates found in column names: array ( 0 => 'sku', 1 => 'store_view_code', 2 => 'attribute_set_code', 3 => 'product_type', 4 => 'categories', 5 => 'product_websites', 6 => 'name', 7 => 'description', 8 => 'short_description', 9 => 'weight', 10 => 'product_online', 11 => 'tax_class_name', 12 => 'visibility', 13 => 'price', 14 => 'special_price', 15 => 'special_price_from_date', 16 => 'special_price_to_date', 17 => 'url_key', 18 => 'meta_title', 19 => 'meta_keywords', 20 => 'meta_description', 21 => 'base_image', 22 => 'base_image_label', 23 => 'small_image', 24 => 'small_image_label', 25 => 'thumbnail_image', 26 => 'thumbnail_image_label', 27 => 'swatch_image', 28 => 'swatch_image_label', 29 => 'created_at', 30 => 'updated_at', 31 => 'new_from_date', 32 => 'new_to_date', 33 => 'display_product_options_in', 34 => 'map_price', 35 => 'msrp_price', 36 => 'map_enabled', 37 => 'gift_message_available', 38 => 'custom_design', 39 => 'custom_design_from', 40 => 'custom_design_to', 41 => 'custom_layout_update', 42 => 'page_layout', 43 => 'product_options_container', 44 => 'msrp_display_actual_price_type', 45 => 'country_of_manufacture', 46 => 'additional_attributes', 47 => 'qty', 48 => 'out_of_stock_qty', 49 => 'use_config_min_qty', 50 => 'is_qty_decimal', 51 => 'allow_backorders', 52 => 'use_config_backorders', 53 => 'min_cart_qty', 54 => 'use_config_min_sale_qty', 55 => 'max_cart_qty', 56 => 'use_config_max_sale_qty', 57 => 'is_in_stock', 58 => 'notify_on_stock_below', 59 => 'use_config_notify_stock_qty', 60 => 'manage_stock', 61 => 'use_config_manage_stock', 62 => 'use_config_qty_increments', 63 => 'qty_increments', 64 => 'use_config_enable_qty_inc', 65 => 'enable_qty_increments', 66 => 'is_decimal_divided', 67 => 'website_id', 68 => 'related_skus', 69 => 'related_position', 70 => 'crosssell_skus', 71 => 'crosssell_position', 72 => 'upsell_skus', 73 => 'upsell_position', 74 => 'additional_images', 75 => 'additional_image_labels', 76 => 'hide_from_product_page', 77 => 'custom_options', 78 => 'bundle_price_type', 79 => 'bundle_sku_type', 80 => 'bundle_price_view', 81 => 'bundle_weight_type', 82 => 'bundle_values', 83 => 'bundle_shipment_type', 84 => 'configurable_variations', 85 => 'configurable_variation_labels', 86 => 'associated_skus', 87 => '', 88 => '', 89 => '', 90 => '', 91 => '', 92 => '', 93 => '', 94 => '', 95 => '', 96 => '', 97 => '', 98 => '', 99 => '', 100 => '', 101 => '', 102 => '', 103 => '', 104 => '', 105 => '', 106 => '', 107 => '', 108 => '', 109 => '', 110 => '', 111 => '', 112 => '', 113 => '', 114 => '', 115 => '', 116 => '', 117 => '', 118 => '', 119 => '', 120 => '', 121 => '', 122 => '', 123 => '', 124 => '', 125 => '', 126 => '', 127 => '', 128 => '', 129 => '', 130 => '', 131 => '', 132 => '', 133 => '', 134 => '', 135 => '', )