Let's say I have a node type "Article" which has a field "File" which is set to handle public files. A lot of articles and files get added.
Now the specs suddenly change and the "Article" will move behind a login and therefore also the attached files must be changed to be not publicly accessible anymore.
I already found out how to change the file system for the file field from public to private pretty easily by reimporting the manually updated
field.storage.node.field_file.yml config. But: this only affects new files that will be added after the switch. It doesn't work for existing files. They still are accessible publicly. Many thousand existing files would need to be manually reuploaded to also make them private.
Does anybody of you have solved that in D8 before? If so, then how?
As all I can think of right now is to programmatically query all "Article" nodes, then foreach through all nodes, get the files, temporarily store them somewhere else, empty the field out, then try to reupload the files programmatically (probably my next question) and then resave each node.
Does that sound reasonable? Or can you think of any other approach that might work here (in D8)?