As I understand it, if you’ve got a CSV that has the image field filled out, simply upload your images into /media/import, and run the CSV. Theoretically, Magento *should* import said images for you.
I was having issues with this as well. I have two testing servers set up and was exporting all products from one and importing all products into the other. If you look at the CSV or XML file you\’ll see that the the image path for all the images are in the directory they are placed in on the server you exported from. So /a/s/myimage.jpg. To import this you need to change that to /myimage.jpg and move it to /media/import as was mentioned here. You just have to make the path correct. A little annoying as it seems like if you move the entire directory structure to the import directory it should find the images, but it doesn\’t. Definitely something to fix in the next release.
I haven’t tried this with 1.5.0.1 but I have done it with older magento versions:
Magento stores images in media/catalog/product/
The 1st subfolder will be the 1st character of the image filename.
The 2nd subfolder will be the 2nd character of the image filename.
Note: CASE SENSITIVE.
So if your image filename is Si1234.jpg, it will be stored in media/catalog/product/S/i/ (media/catalog/product/S/i/Si1234.jpg)
BUT, when importing, Magento looks in media/import/ for the images.
So, if you want Magento to use existing images in media/catalog/product/ for new items, you need to give it directions to that location.
Instead of putting /Si1234.jpg in your image field, put /../../catalog/product/S/i/Si1234.jpg
You have to put the inital slash there. The first dot-dot-slash takes you down from media/catalog/product/ to media/catalog/ and the next dot-dot-slash takes you down to media/
Now that you are down in the media/ folder, you just need to give it directions to your image from there.
Of course, if you are importing from one site to another, you might have a directory structure like www/mysite1/media/catalog/product/ and www/mysite2/media/catalog/product/ and so you will need to adjust for that.
Summary:
In your "image" (and other image fields), Instead of:
/Si1234.jpg
Put:
/../../catalog/product/S/i/Si1234.jpg
Always start with a slash, and adjust the number of ../ for how many levels down you need to go. Then put the path to your image from there.
Well i have made a script to make the csv for import in magento 1.5. But the problem is the image… I have put the image like this in the csv “/imagename.jpg” for the 3 image fields.
all images are put in media/import and still the system won’t import them.
I don’t get any errors so hard to trouble shoot :(
Anyone had this problem and was able to fix this? or know what to do?
I can confirm I am seeing the same issue. I am using the same file and process I used in 1.4.2.0 and on 1.5.0.1 image import is broken during product import.
+ if (file_exists($sourceFile)) { + unlink($sourceFile); + } + if (!@rename($result['path'] . $result['file'], $sourceFile)) { Mage::throwException(Mage::helper('importexport')->__('Source file moving failed')); } Index: app/code/core/Mage/ImportExport/Model/Import/Adapter/Abstract.php =================================================================== --- app/code/core/Mage/ImportExport/Model/Import/Adapter/Abstract.php (revision 96724) +++ app/code/core/Mage/ImportExport/Model/Import/Adapter/Abstract.php (revision 102008) @@ -81,7 +81,7 @@ Mage::throwException(Mage::helper('importexport')->__('Source file path must be a string')); } if (!is_readable($source)) { - Mage::throwException($this->__("%s file does not exists or is not readable", $source)); + Mage::throwException(Mage::helper('importexport')->__("%s file does not exists or is not readable", $source)); } $this->_source = $source;
Upgraded to Magento ver. 1.5.1.0-beta1 - the issue still persists. However, there is a workaround now… You can create a new import profile just for images and bring them in separately. To do so follow the steps below:
go to System > Import/Export > Dataflow - Profiles. Click Add New Profile. Setup a profile and select NO for “Original Magento attribute names in first row” (see attached screenshot) Map the fields to the ones in your CSV Save and Run the profile with your CSV
As long as the product is already imported the image CSV can just have a sku, image, thumbnail, small_image fields.
If the product does not exist, you’ll get an error on that line.