Shopware Version 6.5.6.1
Generate Media Types
First: Make sure, the media file knows what thumbnails needs to be generated, to do this, you run:
bin/console media:generate-media-types --batch-size=5000
More about this can be found here over at anse.de – Especially a shortcut if:
If you have at least one image of each file extension in your media table, you can achieve the same with a very quick SQL query:
Ansgar Becker https://www.anse.de/programming/fixing-no-thumbnail-generation-in-shopwa
Clear Thumbnail Table
Then make sure to clean the thumbnail table to have a clean start. Easiest way is to run a TRUNCATE on the thumbnail table. Before: BACKUP.
TRUNCATE TABLE `media_thumbnail`;
Clear cache
I’m not sure it is needed – and be careful to not take your shop down, because without cache the CPU might be overwhelmed with all the running PHP.
bin/console cache:clear
Delete the thumbnails
Before regenerating, we need to get rid of the old ones. And although you could just run an rm -rf
, I recommend to rename the thumbnails – just in case.
mv thumbnail thumbnail_bak
mkdir thumbnail
And we need to create the thumbnail directory again, because Shopware throws an exception and one doesn’t see it if you don’t monitor your message consumers, like inside of a supervisord.
Last: Generate the thumbnails
bin/console media:generate-thumbnails --async --strict
And then: patience.
In our case regenerating 200.000 thumbnails (for 70.000 images) it took around 2 hours.
One thought on “Shopware 6: Regenerate ALL Thumbnails”