Skip to main content
3 of 3
edited tags; edited tags
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

Is it possible to convert separate (matching) managed files to a single shared file?

I'm finishing up a Commerce store that has tens of thousands of imported products. In a slightly simplified form, here's my problem: Each has a unique primary image and a common secondary image. The import has created a separate secondary image of the exact same file for each product, which obviously creates enormous redundancy and uses much disk space unnecessarily.

Is there a safe way to convert all of the secondary images into a single, shared image in the database and filesystem? (I'm envisioning some kind of database SQL to make multiple products reference the same image, and then hoping that Drupal will clean up the orphan files automatically -- am I looking in the right direction?)

(Drupal 7)

Laryn
  • 1.9k
  • 12
  • 18