Topic on Extension talk:AWS

Can an existing bucket be updated with new images from an /images folder?

5
164.144.55.1 (talkcontribs)

We have been using this extension with success in our non-production wiki, although production still uses the original /images folder on its server filesystem. Now that we are preparing to promote our non-prod system to production, we need a way to trigger this extension's "copy files from /images to s3 bucket" process with the new images that have been uploaded into our production system over the last few weeks. Ideally, it would be nice if it recognized images that already exist in the bucket and only copies new ones over there, but we would be fine with clearing the bucket and triggering another full load, similar to what happened the first time this extension was installed/ran.


I've replaced the old /images folder with a new one containing a few new images, but the AWS extension doesn't seem to be noticing them or uploading them to s3. Is this possible to trigger manually?


Thank you for maintaining this extension! We're using RDS now as well, and are very excited to have stateful data removed from our server to take advantage of better failover/autoscaling.

Edward Chernenko (talkcontribs)

You should copy these files from local directory to S3 bucket manually, e.g. via "aws s3 sync" command from AWS CLI. When this extension is enabled, the local directory is completely ignored by MediaWiki, so images in local directory won't be detected or automatically moved.

164.144.55.1 (talkcontribs)

Thanks! I can try that.


Quick follow up question:

Will this handle thumbnails properly? In the local /images dir, thumbnail file paths appear to be separated into numbered subfolders with more nested numbered subfolders like this

thumb
| - 1
| -- 10
| --- chart.jpg
| ---- 121px-chart.jpg
| ---- 161px-chart.jpg
| ---- 180px-chart.jpg
| ---- 300px-chart.jpg
| --- cat.jpg
| ---- 121px-cat.jpg
| ---- 161px-cat.jpg
| ---- 180px-cat.jpg
| ---- 300px-cat.jpg

Does the extension perhaps rework the thumbnail creation script to create these thumbnails from images after they end up in s3? (In which case I wouldn't need to worry about uploading thumbnails at all, and I would just aws s3 sync the original images and let the thumbnail creation process happen on its own).

164.144.55.1 (talkcontribs)

Sorry about that formatting. Visual editor didn't maintain my indents in those code block lines.

Edward Chernenko (talkcontribs)

You should set

$wgAWSRepoHashLevels = 2; $wgAWSRepoDeletedHashLevels = 3;

to maintain the same naming (with 1/10/cat.jpg instead of just cat.jpg) as in the local directory.

Reply to "Can an existing bucket be updated with new images from an /images folder?"