I was puzzled by the missing images after switching the container to Amazon S3. I finally tracked it down to the fact that storage_api_populate doesn't support image styles.
Fortunately, there's a workaround:
1. enable storage, storage_stream_wrapper, and storage_api_populate
2. set default download method to applicable Storage API option (/admin/config/media/file-system)
3. perform the global migration (/admin/structure/storage/populate) --> this will migrate the files and fields but not the styles, as mentioned above
4. enable https://www.drupal.org/project/imageinfo_cache
5. run drush image-generate and select All when prompted --> this will generate all the style files in the new storage directory
6. create the Amazon S3 container and a class for it
7. switch the stream wrapper to use the S3 class (/admin/structure/storage/stream-wrappers)
8. drush cron
9. verify the site works like normal
Note: my workaround above is not compatible with sites using an Amazon S3 bucket set to "External". Styles will be generated locally, but Storage API attempts to send them to S3 on cron run which silently fails (since the bucket is in read-only External mode) but Drupal thinks the style now lives in S3 so it points the image source to S3 resulting in a broken image icon displayed to the end user on the web page.
Comments
Comment #1
jonhattanAre you still interested in this?
Comment #2
emmonsaz commentedI was puzzled by the missing images after switching the container to Amazon S3. I finally tracked it down to the fact that storage_api_populate doesn't support image styles.
Fortunately, there's a workaround:
1. enable storage, storage_stream_wrapper, and storage_api_populate
2. set default download method to applicable Storage API option (/admin/config/media/file-system)
3. perform the global migration (/admin/structure/storage/populate) --> this will migrate the files and fields but not the styles, as mentioned above
4. enable https://www.drupal.org/project/imageinfo_cache
5. run
drush image-generateand select All when prompted --> this will generate all the style files in the new storage directory6. create the Amazon S3 container and a class for it
7. switch the stream wrapper to use the S3 class (/admin/structure/storage/stream-wrappers)
8.
drush cron9. verify the site works like normal
Comment #3
emmonsaz commented...and yes, I'd love image styles support to be included in the populate module itself!
Comment #4
emmonsaz commentedNote: my workaround above is not compatible with sites using an Amazon S3 bucket set to "External". Styles will be generated locally, but Storage API attempts to send them to S3 on cron run which silently fails (since the bucket is in read-only External mode) but Drupal thinks the style now lives in S3 so it points the image source to S3 resulting in a broken image icon displayed to the end user on the web page.