Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Lost links to existing images when importing new products
 
canuckcrafts
Jr. Member
 
Avatar
Total Posts:  1
Joined:  2012-05-18
 

I hope someone can help me solve this one!

I was importing data in batches to build the database ... the images would not link in the import so I manually edited each one in the Product Manager to display and assigned the Base, Small and Thumbnail settings ... all was going well.

I then did a complete export of data and added some items to the end of the file in the appropriate columns. When I re-imported it wiped out hte links to the images, even though the path was in the file just as it was exported using the Magento Export tool…

I have wasted two days trying to get this working smoothly, and just when I figured I had it .... boom!

Anyone know if the links can be re-established? I don\\\\\\\’t want to go into each product and upload the images again as they are already on the site.

Any help would be appreciated.

Allan

 
Magento Community Magento Community
Magento Community
Magento Community
 
MrFeelgood
Jr. Member
 
Avatar
Total Posts:  22
Joined:  2010-03-01
Leeuwarden
 

As far as I know the path to the images should NOT be the same as the path exported, because the import tool looks for images in the media/import/ folder without the alphabetic folders like: /a/a/. you could replace this with regex: Replace ^/[a-z]/[a-z]/ with /. You you’ll work it out!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mistys
Jr. Member
 
Total Posts:  3
Joined:  2012-02-08
 

I am needing help with this too.  I have read and re-read potential solutions and instructions for days on solving this issue.  I have made media/import folder.  I have magento version 1.7.  I also renamed my images files and just placed / in front of it /image-file.jpg.  I also added the “_1” (really don’t need to cause magento does it for me) and even “image”, “small” , and “thumbnail”.  Every time I import new products, all my existing images goes blank.  When I clean out the catalog/product/cache the images disappears on the front end.  I have 2 stores.  I am just at my wits end on how to import new products/images without wiping out the existing images.  I been importing/exporting through dataflow.  That’s another thing, I see import, export, dataflow in backend system menu.  That confuses me on which one i should use.

Michelle

 
Magento Community Magento Community
Magento Community
Magento Community
 
Roy Russo
Jr. Member
 
Avatar
Total Posts:  2
Joined:  2010-04-26
Israel
 

In app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php

move line 1226 two lines up (inside the if statement ) so the new code will be

if (!array_key_exists($rowData[$imageCol]$uploadedGalleryFiles)) {
    $uploadedGalleryFiles[$rowData[$imageCol]] 
$this->_uploadMediaFiles($rowData[$imageCol]);
    
$rowData[$imageCol] $uploadedGalleryFiles[$rowData[$imageCol]];
}

This will not fix all the problems, but at least I can now import my products if they already have images.

 
Magento Community Magento Community
Magento Community
Magento Community
 
bc28001
Jr. Member
 
Total Posts:  16
Joined:  2011-08-08
 
roy_russo - 04 June 2012 01:11 PM

In app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php

move line 1226 two lines up (inside the if statement ) so the new code will be

if (!array_key_exists($rowData[$imageCol]$uploadedGalleryFiles)) {
    $uploadedGalleryFiles[$rowData[$imageCol]] 
$this->_uploadMediaFiles($rowData[$imageCol]);
    
$rowData[$imageCol] $uploadedGalleryFiles[$rowData[$imageCol]];
}

This will not fix all the problems, but at least I can now import my products if they already have images.

Chief i have magento 1.7 and i was having the same problem .
and thanks to your solution i got my issue fixed.
ok thanks so much

 
Magento Community Magento Community
Magento Community
Magento Community
 
Roy Russo
Jr. Member
 
Avatar
Total Posts:  2
Joined:  2010-04-26
Israel
 

I think I have succeeded to solve the bug in a better way.
Now new images can be imported, and old images keep their values.

if (!array_key_exists($rowData[$imageCol]$uploadedGalleryFiles)) {
    $uploadedGalleryFiles[$rowData[$imageCol]] 
$this->_uploadMediaFiles($rowData[$imageCol]);
}
// if images are new, the raw data should be the new image file
// if images are already loaded,  should not be called
if (substr_count($rowData[$imageCol]'/') == 1{
    $rowData[$imageCol] 
$uploadedGalleryFiles[$rowData[$imageCol]];                        
}
 
Magento Community Magento Community
Magento Community
Magento Community
 
ironlion37
Jr. Member
 
Total Posts:  13
Joined:  2013-06-11
 

Here is the answer for 1.7.2:

http://www.magentocommerce.com/answers/Images-lost-during-export-import-process#answer4013

Cheers!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Leorex2012
Jr. Member
 
Avatar
Total Posts:  8
Joined:  2012-10-03
 
ironlion37 - 27 June 2013 07:14 AM

Here is the answer for 1.7.2:

http://www.magentocommerce.com/answers/Images-lost-during-export-import-process#answer4013

Cheers!

This link is now a dead end.  I’m trying to get multiple images to import.  Can anybody re-direct to the new location or offer more help?

BTW, I am running Magento Community Edition 1.7.0.2.

 
Magento Community Magento Community
Magento Community
Magento Community
 
bartom34
Jr. Member
 
Total Posts:  18
Joined:  2011-10-25
 
Roy Russo - 29 August 2012 12:23 AM

I think I have succeeded to solve the bug in a better way.
Now new images can be imported, and old images keep their values.

if (!array_key_exists($rowData[$imageCol]$uploadedGalleryFiles)) {
    $uploadedGalleryFiles[$rowData[$imageCol]] 
$this->_uploadMediaFiles($rowData[$imageCol]);
}
// if images are new, the raw data should be the new image file
// if images are already loaded,  should not be called
if (substr_count($rowData[$imageCol]'/') == 1{
    $rowData[$imageCol] 
$uploadedGalleryFiles[$rowData[$imageCol]];                        
}

Thank you so much !

This solution fix the problem for me.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top