Magento 1.x Security Patch NoticeFor Magento Open Source 1.5 to 1.9, Magento is providing software security patches through June 2020 to ensure those sites remain secure and compliant. Visit our information page for more details about our software maintenance policy and other considerations for your business.

Working with CSV Files

CSV files have a specific structure that must match the database. Each column heading must exactly match the Attribute Code of the attribute that is represented by the column. To ensure that the column headings can be read by Magento, first export the data from your store as a CSV file. You can then edit the data and re-import it into Magento.

Important! We recommend that you use a program that supports UTF-8 encoding to edit CSV files, such as Notepad++ or OpenOffice Calc. Microsoft Excel inserts additional characters into the column header of the CSV file, which can prevent the data from being imported back into Magento.

The catalog products CSV file contains information about products and the relationships between them. The table has the following structure:

Exported Product CSV in OpenOffice Calc

The first row of the table contains the names of the columns, there are two types of the names, as shown in the following table. Other rows contain attributes values, service data, and complex data. If a row contains the value in the SKU column, then this row the rows below it describe the product. Each new SKU value begins the description of the next product.

Each category is entered as a path, with a forward slash (/) between each level. For example: Furniture/Living Room. Do not include the Root Category in the path.

During import, if a row that contains the SKU value is found to be invalid, then the row, and all other rows with data for that product cannot be imported.

The minimal table that can be imported contains only the SKU column, which can be used to delete records from the database. There is no limit to the number of the columns he table can have. Columns without data are ignored during the import process.

Exported Product CSV in Notepad++

CSV Product Structure

Column Name

Description

_<name>

The names of the service columns and complex data columns. Service columns contain entity properties, which are not attributes. For example, columns with website or product type information are service columns. The underscore as first character is used to distinguish these columns from the attribute column names.

<attribute name>

The names of the columns with values of both system-created attributes and attributes created by the store administrator.

The customers CSV file contains customer information from the database, and has the following structure:

Exported Customer CSV in OpenOffice Calc

The first row of the table contains the names of the attribute columns (which are the same as attribute codes). There are two types of column names, as shown in the following table. Other rows contain attribute values, service data, and complex data. Each row with non-empty values in the “email” and “_website” columns starts the description of the subsequent customer. Each row can represent customer data with or without address data, or the address data only. In case a row contains only the address data, values in the columns, related to the customer profile, will be ignored and may be empty.

To add or replace more than one address for a customer, in the import file add a row for each new address with empty customer data and the new or updated address data below the customer data row.

Exported Customer CSV in Notepad++

CSV Customer Structure

Column Name

Description

_<name>

The names of the service columns, and complex data columns. Service columns contain entity properties, which are not attributes. For example, columns with website or store information are service columns. The underscore as first character is used to distinguish these columns from the other attributes names.

The “_address_default_billing” and the “_address_default_shipping” columns are the default billing and shipping addresses flags. If the address in the row is the default billing and/or shipping address of the client, the “_address_default_billing” and/or “_address_default_shipping” columns in this row will have the “1” value.

<attribute name>

The names of the columns with values of both system-created attributes, and attributes created by the store administrator.