Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.Files uploaded via Drupal to remote storage (S3 in my case) appear in the list of files admin/content/files immediately.
However, all the other already existing files and folders on S3 are not listed in Drupal.
How to make sure all remote files and folders show on admin/content/files?
Comments
Comment #2
esolitosThis is to be expected, because what you see in admin/content/files is what is in the Drupal database, not what is in the filesystem, the same exact behaviour can be observed in a standard Drupal installation if you manually add files in the public directory (Usually sites/default/files), no file will be shown unless you upload them via Drupal itself.
Comment #3
vacilando commentedIt is attractive to use Flysystem to attach a pre-existing file repository (say a file bank or an image gallery) so that those files can become available to Drupal.
Because of this issue, however, it does not work. It is not practical to have to upload each and every image to be able to browse them through Flysystem.
If this does not work out of the box (as explained by @esolitos, thanks for that), would it make sense for this module to provide a way to synchronize the Flysystem-attached file repository to the Drupal database?
Comment #4
joumI feel that this would be the killer feature of this module.
As it stands, there is no way of letting Drupal know of/manage existing assets in the remote file system. This makes (ie) migrations very hard to accomplish, as it requires two steps: a first step to let Drupal "import" remote files (no import actually needs to happen, Drupal just needs info about them in the DB), and second, a step to create/update the content using those file references.
If there was a way to create/sync those references to remote files automatically, the import of content would be more or less trivial.
Not sure how this could be implemented to work consistently accross different remote file systems, though. Even so, I propose changing the category of this ticket to feature request.
Comment #5
benjifisherI did this on a recent migration project. After copying the files from old cloud storage (S3) to new storage (GCS) I generated a list of missing files and saved it as a CSV. I then used this migration to track the files in the
file_managedtable (i.e., to create File entities):If you want Flysystem to do the work for you, then that would be a feature request.
Comment #6
lisa.rae commentedAnother potential solution might be the External Entities module.
Comment #7
lisa.rae commented