After a full migration to the production server I noticed that some filenames of the swatch colors wasn't matching with their respective color attribute name (a code in the filename was in lowercase instead being the opposite), so I took the decision to capitalize the whole filename (except the filename extension) and the attribute value for every color.
As anybody would guess, I renamed all the files in the folder using a Bash script and the attribute values using a SQL update statement, but now none of the swatch images shows up (but the swatches display the attribute name in uppercase as it should be, even in the Admin Panel). The swatch folder (media/catalog/swatches) is gone. The IMG tag is not being created. The source swatch folder (media/wysiwyg/swatches) where the files are uploaded, is OK.
I flushed the swatch image cache (then the whole cache) and reindexed the Product Attributes index (then all the indexes). Exception.log says nothing about the issue.
Seems like something is broken but I don't know what.