Inhalte aufrufen

Profilbild

Lost images during upgrade


Best Answer nickh , 17 April 2023 - 17:30

FYI, I rolled back to v3.1.5 and then went straight up to v4.2 and the images seem to work!

Go to the full post


  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
8 Antworten zu diesem Thema

#1 nickh

nickh

    Erfahrener Benutzer

  • Members
  • 129 Beiträge

Geschrieben: 03 April 2023 - 15:31

Hi,

 

I'm attempting to upgrade a very old site, currently running v2.0.1, to v4 (or higher).  I have been incrementally upgrading to ensure that all functionality continues to work and I've made it as far as 3.1.5, but I've just discovered that many of the images are now missing.

 

Back in v2.0.1, all images were stored in /Media, and I can see that this has now changed to /App_Data/Tenants/{tenant}/Media, but copying the image files into the new directory hasn't resolved it.  It looks like they should be inside the Thumbs subdirectory, but all of my images are still in the root /Media directory, and would need to be renamed (they are currently just like 0008836-0.jpg), and then I believe moved into the appropriate subdirectory (e.g. Media/Thumbs/0011/[picture_id]-[picture_seo_name]).

 

I think I could write a program to loop through all of these images (there are about 2500!), lookup the appropriate SeoFilename from the dbo.Picture table, and then write the image into appropriate Thumbs subdirectory, but this will be very fiddly.  It also won't solve my next problem:

 

It looks like there should also be size-specific versions of each image file (e.g. 0010253-party-porcelain-blue-large-plates-180.jpg), but I don't know how these are created.

 

What do you suggest I do?  Reloading 2500 images is obviously out of the question! :)



#2 stefanmueller

stefanmueller

    SmartStore AG

  • Administrators
  • 459 Beiträge

Geschrieben: 03 April 2023 - 22:39

Hi Nick, maybe Product Import can help you. You can create a CSV for import with image URLs, those referenced images will be fetched over the wire and your products can be updated with the new images.

 

You need only one good base pic like 1000x1000 pixel sized, thumbs will be done by the system on its own (in Smartstore 5 you can even finetune how the thumbnail downscaling is done)

 

If you need more help, we are happy to do upgrading it for you. Please ask for a quote.

 

Docs:

 

https://smartstore.a...orting Products Images

Product images can be imported by URL. Multiple URLs can be separated by a pipe |.

ImageUrls

If ImageUrls just contain file names or relative file paths, the product importer searches the folder of the import profile for image files. Example: For an import value of Content\MyImages\ProductPicture.jpg the product importer expects the file under \App_Data\ImportProfiles\name-of-my-import-profile\Content\MyImages\ProductPicture.jpg.


Stefan


#3 nickh

nickh

    Erfahrener Benutzer

  • Members
  • 129 Beiträge

Geschrieben: 04 April 2023 - 17:26

Hi Nick, maybe Product Import can help you. You can create a CSV for import with image URLs, those referenced images will be fetched over the wire and your products can be updated with the new images.

 

You need only one good base pic like 1000x1000 pixel sized, thumbs will be done by the system on its own (in Smartstore 5 you can even finetune how the thumbnail downscaling is done)

 

If you need more help, we are happy to do upgrading it for you. Please ask for a quote.

 

Docs:

 

https://smartstore.a...orting Products Images

Product images can be imported by URL. Multiple URLs can be separated by a pipe |.

ImageUrls

If ImageUrls just contain file names or relative file paths, the product importer searches the folder of the import profile for image files. Example: For an import value of Content\MyImages\ProductPicture.jpg the product importer expects the file under \App_Data\ImportProfiles\name-of-my-import-profile\Content\MyImages\ProductPicture.jpg.

 

Hi.

 

Thanks for the suggestion, but for me to be able to import the products, I would first have to export them and I don't really want to pay for the plugin to do this - especially since it's just the images that are missing.

 

Please could you show me the code that automatically creates the resized versions of the product image?  I'm wondering if I could call into this from a unit test (or similar), to update the images programmatically?



#4 stefanmueller

stefanmueller

    SmartStore AG

  • Administrators
  • 459 Beiträge

Geschrieben: 07 April 2023 - 16:03

https://github.com/s...search?q=resize

 

the first hits there look like a great starting point


Stefan


#5 nickh

nickh

    Erfahrener Benutzer

  • Members
  • 129 Beiträge

Geschrieben: 11 April 2023 - 15:56

Thanks, I've managed to sort this out through lots of horrible string manipulation!



#6 nickh

nickh

    Erfahrener Benutzer

  • Members
  • 129 Beiträge

Geschrieben: 11 April 2023 - 17:25

Damn it - I spoke too soon!  I thought everything was working perfectly, but then I upgraded again to v3.2.2 and it now appears to try to find xxxx-q90.jpg (instead of xxxx.jpg).

 

Does anyone know why this has changed, and why the migration didn't make the necessary changes to the files?



#7 Artar

Artar

    SmartStore AG

  • Administrators
  • 988 Beiträge

Geschrieben: 12 April 2023 - 15:14

Hello Nick,

 

I would suggest starting from scratch.
If the base version is 2.0.1, I would update as follows:

 

2.0.1 -> 2.2
2.2 -> 2.6
2.6 -> 3.0.3
3.0.3 -> 3.2.2
3.2.2 -> 4.2
(4.2 -> 5)

 

Before that, I would temporarily set the connection timeout of the SQL server to a very high value (better 0 for unlimited).

Then I would set the media storage in the Smartstore backend under Configuration -> Settings -> Media to Filesystem.

 

If your Smartstore is running on a slow hosting, I would download everything and do the update locally on a fast PC.

 

Also, the possible database size should not be too small. During updates, the database can become twice as big for a short time.

 

For shops with a lot of content, it is better if the app pool runs in 64-bit mode so that more RAM is available.


Zihni Artar
SmartStore AG


#8 nickh

nickh

    Erfahrener Benutzer

  • Members
  • 129 Beiträge

Geschrieben: 14 April 2023 - 10:09

Hello Nick,

 

I would suggest starting from scratch.
If the base version is 2.0.1, I would update as follows:

 

2.0.1 -> 2.2
2.2 -> 2.6
2.6 -> 3.0.3
3.0.3 -> 3.2.2
3.2.2 -> 4.2
(4.2 -> 5)

 

Hi Artar,

 

Thanks, but this is EXACTLY what I have already done (plus I also went from 2.6-> 3.0.3, 3.0.3->3.1.5, 3.1.5->3.2.2).

 

The images were working fine in v3.1.5, but as soon as I went up to 3.2.2 they are now throwing a 404 error, because the code is looking for a "q90" version of the image.  Everything else seems to be working perfectly, so it seems like there has been a bug in the upgrade.

 

Does anyone know how I can fix this?



#9 nickh

nickh

    Erfahrener Benutzer

  • Members
  • 129 Beiträge

Geschrieben: 17 April 2023 - 17:30   Best Answer

FYI, I rolled back to v3.1.5 and then went straight up to v4.2 and the images seem to work!


  • Artar gefällt das