The import procedure accepts delimited data files (CSV delimited using either a comma, pipe, tab or semicolon). The first row must contain the header row with the column names. The actual column ordering may vary. Even if a column is not a required field, the column must still be present in the CSV file. It’s recommended to enclose all column data in double quotes (e.g. "Apple iPad" or "149.99") to escape any delimiter characters present in the text.
CSV files are processed row by row from top to bottom. For new insertions, if you have any parent child dependency, you should ensure the parent's row appears before the child's row. The row sequence is not needed for updates or deletes. For example, the "Laptop" category has a parent category called "Computers". If you're inserting both categories at once, the "Computers" row should appear before the "Laptop" row. Similarly, you cannot insert product variants if the product does not yet exist since product variant has a dependency on the product.
The actual type of operation performed by the import routine depends on the action specified in the Act column (Insert, Update, Delete). In your CSV file, you can have a few rows that insert, followed by other rows that update or delete as long as those actions are allowed by that entity type. See each entity type for the available actions.
Most of the columns map directly to the same fields you find the Storefront admin interface. Therefore, it's good idea to start by creating a few sample entries in your Storefront to understand how the data is being used and export out the file to see what the actual data looks like.
When inserting new data, you can leave the database object identifier blank (e.g. ProductID) as it will be automatically generated by your database. However, when you perform an update or delete action, you need to make sure the database object identifier is specified. When deleting, only the database object identifier is required. Therefore, in order to obtain the database object identifier, you must have exported out the data first before performing an update or delete action. It is good practice to always export and use the latest data before updating because the data may have changed by another user from the Storefront adminstration page or automatically changed by the system (e.g. the product variant inventory count may have decreased from customer purchases).
Object keys are available for many entities such as category, product, manufacturer, etc. that you can use in place of object identifiers to reference related objects by their unique key rather than with the database generated object identifier. For example, you can name your product key "apple-ipad" to make it easier to recall when you need import product categories rather than referencing by its identifier number "831". To display the object keys in the merchant interface, you must first enable the Show object key feature under Configuration > General.
If your site operates in multiple languages, the data exported out or being imported into depends on the currently viewed page language. For example, if you're browsing your site in English (United States), any localizable string value in the CSV file will be treated in the en-US locale. If you later switch over to French (France), any localizable string value in the CSV file will be treated in the fr-FR locale.
During import, when possible, the Storefront will perform a series of validation row by row and will automatically rollback the entire data changes if any incorrect data is detected to protect the integrity of your system. Even with the automatic validation and transaction rollback, we still recommend that you perform a complete backup of your system before performing any import.
Please note that Web applications are limited by network, CPU and allowed memory consumption. When importing large amount of data, it is recommended to run multiple smaller imports (e.g. import 10,000 records at a time instead of 100,000 records at once).
We recommend using Google sheets to edit your CSV file. It's free and is hosted online with nothing to install. Once you're done editing, you can download it back as CSV file.
In most cases, you can simply double click the CSV file you exported to open it in Excel for editing. Please note, however, that Excel by default will attempt to convert numbers into its own native format. This may present a problem for fields like SKU that is normally a text field. For example, if your SKU values consist of only long numbers such as "12231231243", Excel will convert it to a number format and it will end up showing on your screen as "1.22E+10". The proper way to open a CSV file is to start with a blank Excel spreadsheet and perform a data import.
Powered by Revindex Wiki