damian_nz - 6 months ago

I am migrating all the images in a site to s3. The overall gist of it I have covered (update DB for files to new disk and folder) but the issue I have is that I am optimising the images also. This means that the file sizes and dimensions have changed.

Is there some way to sync the new image values with the ones in s3? Or even simply remove all the ones ones in the DB?

Answer

ryanthompson - 5 months ago

Hmm you could use the image service in your importer and use the output cache / dump/inline method to push new image data to the remote.

ryanthompson - 6 months ago

Use the mount manager per Files docs: https://pyrocms.com/documentation/files-module/2.4/integration/flysystem-package

And put the files on the disk that way - then it'll sync DB for you and actually migrate the files to S3 as well.

The whole idea of the files module integration with Laravel stuff is so that the DB is transparent - just use the filesystem / storage as you would and the DB is kept in sync.

Hope this helps!

damian_nz - 5 months ago

Hey Ryan

Sorry I have moved them ok, the main issue I have it that some of the images needed optimising so the file sizes and dimensions have changed from what the values in the DB are.

ryanthompson - 5 months ago

Hmm you could use the image service in your importer and use the output cache / dump/inline method to push new image data to the remote.