So, you are about to import a large amount of products into Magento. Well, there are a couple of different approaches available. First, you could use the ancient Data Flow import based on specific profiles. Then, you could use the improved Data Import version, which still is (very) resource consuming. Lastly, there is magmi – a highly efficient tool to mass import data to Magento, which is the preferred way to go in almost all cases when dealing with larger sets of product data in Magento. This post shows how to mass import products to Magento multi-store setups using magmi.
First, you need to export existing products as a CSV file. This can be achieved (again) using Data Flow, Data Import or a more elaborate database dump. Let’s assume at this point that you have a CSV file ready (very convenient, I know). In case you don’t, simply run the built-in Data Export funtion from within the admin backend (specify only those columns you definitely need to keep the processing to a minimum) or use the default Export All Products Data Flow profile. Edit this CSV to your needs so that you have a working set of products to be imported afterwards. Make sure at this point to retain the required columns so that you don’t run into problems afterwards. The columns required for the import process depend on the scenario at hand but rest assured you need at least sku, store and any additional attribute such as name or description.
Export data manipulation tools
Make sure to edit your CSV file with a tool that is capable of handling UTF-8 correctly and also supports setting proper delimiters. LibreOffice is a very handy solution to do this. You can easily use the Save as functionality to set proper delimiters for magmi to import your edited CSV afterwards. Use comma (,) and “ as column separators, which is the default setting. Here is a working sample CSV extract with the respective required columns in the first row:
"sku","description","short_description","name","store" "sample-1","My shiny product for Englisch store","Shiny product","Product A EN","en" "sample-1","My shiny product for German store","Shiny product","Product A DE","de"
CSV import schema
In order to mass import products for particular store views in a multi store setup make sure that the store column is set correctly with the store view code. Have a look at core_store table or at the admin backend under System / Manage Stores to determine to correct store view code.
Note: The regular Data Import interface provided by Magento will activate the “Use default” setting on various attributes of the imported/updated products, thus potentially doing something you are not intending with importing/updating products! Instead, use magmi and the store column to explicitely set set which products to import into which store view.
Note that you can also specify a list of store codes for the store column. The fastest and (imho) safest way to mass import products to Magento is Magmi – the Magento Mass Importer. Next, we are going to setup magmi and set up a profile to mass import products.
First, download and install magmi and protect it from outside access (e.g. via .htaccess). Note that by default, the web interface will be accessible by everyone who knows the corresponding URL! Open the web interface: http://www.your-domain/magmi/web/magmi.php and
- Edit the global settings
- add and edit the import profile
Edit global configuration
Create an import profile
Make sure to enable the Magmi Optimizer as this will speed up the process significantly, especially when dealing with thousands of entries.
Finally, choose your CSV import file and set the import mode. You can choose between three different modes:
- Update existing items only, skip new ones
- Create new items, update existing ones
- create new items, skip existing ones
Again, for multi-store setups make sure that the store column contains the correct store code view code. The import process should run pretty fast using magmi.
Optionally, you can choose to kick off the reindexing process using magmi (enable the option Magento Magmi Reindexer), run the indexer with the shell script provided by Magento or use the corresponding admin backend option.