S3 File System to Support Multiple Buckets

Created on 28 June 2018, over 6 years ago
Updated 16 February 2023, almost 2 years ago

This is not an issue but a request for help. Kindly share some ideas on the below,

Our site is using s3fs module to store files in S3 bucket. We have stored both public files and private files to a single S3 bucket and the same has been set up correctly in Drupal S3 File System configuration.

Now, we have a new requirement to create a public S3 bucket and a private S3 bucket where we need to store all the publicly accessible files in public S3 bucket and the private files to be stored in private S3 bucket. I'm aware that s3fs module is designed to support only one S3 bucket. I can set the bucket used by s3fs to store private files and I can create a custom module to support additional S3 bucket (Public Bucket) and migrate all public files from s3fs Bucket to custom module's public bucket.

Now the problem is, the existing Drupal file fields that already stored the files to s3fs's bucket need to be modified and the references should be updated to new custom module's public bucket. I had a look into the tables 3fs_file and file_managed but i'm not seeing the s3fs bucket related information. I want to set the existing file fields storage of file_managed to my_custom_public_s3fs. Currently, in the field settings page, file_managed is disabled and i couldn't manage/set the storage of file system as the file has values stored in DB already.

Could someone please give me some lights on this?

Any of your suggestion will be more appreciable and helpful. Thank you in advance.

Feature request
Status

Closed: outdated

Version

4.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States cmlara

    I believe we can consider this fixed by 📌 4.x Version Fixed

  • 🇬🇧United Kingdom 8bitplateau

    Really sorry, feel free to close again, but.. 4.x is not out yet, only 3.6.
    I am running Drupal 10.3, so here is the patch from #19 rerolled with the config alters implemented in the S3fsFileSystemD103 class.
    This works for me. I have a custom entity module I've written which overrides the main installation's settings which is used for something else. This may be counterproductive at the moment etc (sorry again), but it's a working solution for overriding config settings for D10.3 while waiting for 4.x.

  • 🇨🇦Canada b_sharpe

    Leaving closed as this is obviously a 4.x thing as mentioned, but the following patch fixes the issues mentioned in #21 as I was having that exact problem of two streams initialized in a single request resulting in incorrect config.

  • While waiting for 4.x we need this functionality and started developing with the patch in #23 but found it causes an error when init() is called in stream_flush() as it doesn't pass a $scheme argument so rerolled that patch to add defaulting to NULL to the argument.

Production build 0.71.5 2024