Uploading multiple items including images into your Magento CE store

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:

http://prattski.com/2011/07/15/magento-revised-multiple-image-import-module-1-5/

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 1.7.0.2 the version that I'm using presently.

 

To bulk import products and images to Magento CE 1.7.x.x:

  1. Back up your Magento installation
  2. 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
  3. Create the required directories in your Magento installation:

     

     

     

    1. Navigate to the  public_html/Magento/media/ directory
    2. Create the import directory (It's not usually present in the CE edition)
  4. Create an export file template:

     

     

     

    1. Go to System -> Import / Export -> Data flow – Profiles
    2. Create a new profile by clicking on add profile and set the following parameters:

    3. Under Export filters, enter the SKU that you want to use as your template and the click save profile
  5. Run the Tutorial Export profile by:

     

     

     

    1. Select Tutorial Export
    2. Run profile and then Run Profile in pop up. You should then see the following message in the pop up:
  6. Now from your file manager, navigate to public_html/magento/var/export and download the Tutorial Export.csv file to your computer.
  7. Since we are only using the export profile to add images, delete all of the columns except

     

     

     

    • sku
    • name
    • websites
    • image
    • image_label
    • thumbnail
    • thumbnail_label
    • small_image
    • small_image_label
    • additional_images
      (Note that we can arrange the columns in any order that you want)

       

       

       

       

      Tutorial Import test items for profile.csv
       

  8. Next, we need to create the data structure template that we are going to be using for the bulk import operation:

     

     

     

    1. Go to System -> import / export -> export
    2. Select entity type : Products
    3. Scroll down to the bottom of the screen and click continue
    4. Open the resulting file
    5. 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
    6. Copy the store name that you have assigned the item to the _store column, in this case devthisandthat
    7. Delete all other lines below the first row as they are used for the images
    8. Delete the following columns:

       

       

       

      • gallery
      • image
      • image_label
      • small_image
      • small_image_label
      • thumbnail
      • thumbnail_label
      • updated_at
      • url_key
      • url_path
      • _media_attribute_id
      • _media_image
      • _media_lable
      • _media_position
      • _media_is_disabled
      • created_at

    This is now the template we are going to use to create our new products.

    Import tutorial new product structure for bulk import

  9. Save this file as Import tutorial new product structure for bulk import.csv
  10. Now we are going to copy the first data line of the Import tutorial new product structure for bulk import.csv 2 other times to make our 3 items. Your file should now look like this:
  11. 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 .
     
  12. Open the Tutorial Export.csv file

     

     

     

    • We're also going to assign an image to each of them using the image import module that we added at the beginning:

       

       

       

      • Test_Import_image_one.jpg
      • Test_Import_image_two.jpg
      • Test_Import_image_three.jpg
    • Going back into our Excel file , copy the first row and use that as our template to create our 3 items:
  13. Upload your 3 images to the public_html/magento/media/import directory
  14. In the Tutorial Export.csv Excel 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.
  15. Select your images for the 3 main Magento image types; Image, Thumbnail and small. They can also all be the same image
  16. Save your file as Tutorial Import test items for profile.csv
  17. Upload your updated CSV file to public_html/magento/var/import:
  18. Now we are going to create an import profile to load in our new items.
  19. 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)
  20. 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.
     
  21. Select Local / Remote Server and enter the following parameters:

  22. Under Date format set the following parameters:
  23. Now save the profile.

  24. Use the bulk import function to create the new product structure.

    1. Go to System -> Import / Export -> Import
    2. Click on browse to select the Import tutorial new product structure for bulk import.csv file, then click on check data
    3. 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:
    4. If everything checks out then click on the import button to begin the bulk import operation. If everything works correctly you'll see:
  25. Next we are going to run the Import tutorial data flow profile.

    1. Go to System -> import / export -> data flow profiles and select the Import tutorial data flow profile
    2. Then from the left navigation select Run profile and then run profile in pop up. You should then see the following message:
       
  26. 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
     
  27. 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.

 

Comments are closed.