This one gave me a lot of grief and I mean a lot. I searched high and low for a way to import bulk images into Magento CE. Found a lot of information on doing it with Magento GO & Enterprise but nothing on the 1.7.x.x community edition. I tried several methods to get the bulk image import to work correctly and eventually resorted to reading the server's error logs and then when that didn't work I was going to go through the code and try to determine where Magento was looking for the image files. But in doing that search I landed on this page:
Problem solved! But a lot learned about the inner workings of Magento
There are 2 methods of import / Export in Magento:
- Bulk import / export for the complete database
- Data flow profiles
The bulk import / export function is used to make changes to the entire database,while data flow profiles can be used to import / export specific parts of the database. In this method we are going to use the bulk import / export function to create the basic structure for the new items that we want to add and the Data flow profile to add the extra information to our newly created items, most importantly of all the images.
Before we get started, I am assuming that you are able to understand how we add a module to the local code base of Magento. This does require an advanced knowledge of Magento as well as web design as we will need to work with server directly in order for this import process to work. This method works in Magento CE 22.214.171.124 the version that I'm using presently.
To bulk import products and images to Magento CE 1.7.x.x:
- Back up your Magento installation
- Follow all of the steps in http://prattski.com/2011/07/15/magento-revised-multiple-image-import-module-1-5/ to create the image import module in your Magento installation
Create the required directories in your Magento installation:
Navigate to the
importdirectory (It's not usually present in the CE edition)
- Navigate to the
Create an export file template:
- Go to System -> Import / Export -> Data flow – Profiles
Create a new profile by clicking on add profile and set the following parameters:
Under Export filters, enter the SKU that you want to use as your template and the click save profile
Run the Tutorial Export profile by:
- Select Tutorial Export
Run profile and then Run Profile in pop up. You should then see the following message in the pop up:
Now from your file manager, navigate to
public_html/magento/var/exportand download the
Tutorial Export.csvfile to your computer.
Since we are only using the export profile to add images, delete all of the columns except
(Note that we can arrange the columns in any order that you want)
Next, we need to create the data structure template that we are going to be using for the bulk import operation:
- Go to System -> import / export -> export
- Select entity type : Products
- Scroll down to the bottom of the screen and click continue
- Open the resulting file
- Locate the item that you want to use as your template to create the new items and delete all of the other entries. In this case we are using Test_001
- Copy the store name that you have assigned the item to the _store column, in this case devthisandthat
- Delete all other lines below the first row as they are used for the images
Delete the following columns:
This is now the template we are going to use to create our new products.
Save this file as
Import tutorial new product structure for bulk import.csv
Now we are going to copy the first data line of the
Import tutorial new product structure for bulk import.csv2 other times to make our 3 items. Your file should now look like this:
Create your 3 Sku's Test_Import_item_one,Test_Import_item_two and Test_Import_item_three and change them to your liking. You should at least change both descriptions, the costing and inventory quantities. Now save the new file .
We're also going to assign an image to each of them using the image import module that we added at the beginning:
- Going back into our Excel file , copy the first row and use that as our template to create our 3 items:
- We're also going to assign an image to each of them using the image import module that we added at the beginning:
Upload your 3 images to the public_html/magento/media/import directory
Tutorial Export.csvExcel file create a new column called "additional_images" and add the names of each image file that you want to import:
Remember that with this module you can import multiple images by adding a ";" between each filename. Also don't forget to add the "/" at the start of each filename. The additional_images column will create your photo gallery.
Select your images for the 3 main Magento image types; Image, Thumbnail and small. They can also all be the same image
Save your file as
Tutorial Import test items for profile.csv
Upload your updated CSV file to
- Now we are going to create an import profile to load in our new items.
Create a new profile with the following settings:
(Do not select the store that you want to import to or the images will not show up)
Under file information you will see the Data transfer drop down, we must change this to local / remote server. If we use the interactive mode Magento will not be able to locate the images that we're importing.
Select Local / Remote Server and enter the following parameters:
Under Date format set the following parameters:
Now save the profile.
Use the bulk import function to create the new product structure.
Go to System -> Import / Export -> Import
Click on browse to select the
Import tutorial new product structure for bulk import.csvfile, then click on check data
Magento will then check the data file for errors. If there aren't any you will see the following message at the bottom of the screen:
If everything checks out then click on the import button to begin the bulk import operation. If everything works correctly you'll see:
- Go to System -> Import / Export -> Import
Next we are going to run the Import tutorial data flow profile.
- Go to System -> import / export -> data flow profiles and select the Import tutorial data flow profile
Then from the left navigation select Run profile and then run profile in pop up. You should then see the following message:
Go into your store and check to make sure that the items along with the images were imported successful. The items used in this tutorial are located on my development site at http://dev.store.aandgwebtech.ca/index.php/avon-products/uncategorized.html
- You've done it. I know that this is a lot of steps to bulk import data with images into your Magento store, but once you practice this a few times it will get easier. It's still much faster then having to manually select each image one at at time for each item especially if you have a lot of items to import.