This question is about both a specific detail and a general approach.
In the course of trying to delete some backup files, I got this message after saving the change (the deletion of the files):
Warning: chmod(): Operation not permitted in /home/www/blahbalhbalh/web/moodle/lib/filestorage/file_storage.php on line 1900
I am assuming that this error has to do with the ownership of files under moodledata/filedir. The files themselves have 777 permissions, so that, in and of itself, is not the issue.
So, the detailed question is whether someone can confirm that the files concerned are in the filedir area and can someone tell me what the program was trying to do when it failed.
The more general question concerns the strategy for moving from a test to a prod environment, and its impact on the above issue. My initial strategy was to develop a site in a test environment and when it was ready, to copy the file system from test to prod (both the moodle and the moodledata areas), and to backup the test database and restore it to prod. The configurations that depended on things like the host name and installation location were also updated in prod.
Until, this approach has worked fine. But, because my prod environment is a shared platform, I cannot manage the files that belong to the Apache account. So, when files are added programmatically to anywhere under moodledata, their owner is the Apache account. But the original files in prod all belong to an account that I manage. While I can take ownership of Apache account files, I cannot do the opposite.
I am assuming that this issue is at the source of the problem I am now seeing above, although I am not really sure why. But more importantly, is there a different way of migrating wholesale the files in moodledata/filedir to another site such that the owner remains the Apache account on my shared platform? The only things I can think of are:
a) upload all those files again using Moodle, which is both extremely tedious, error-prone, and would require my abandoning the whole approach of the initial setup of the prod env. based on the test env.
b) asking my hosting provider to change the ownership of the files, which is something they have been loathe to do in the past.
c) moving to a new hosting provider or to a platform dedicated to me, that I more fully control, which is a major step I would like to avoid, if at all possible.
Any other suggestions?