2.8.3 Migrated to another partition, now files are lost

2.8.3 Migrated to another partition, now files are lost

by Wendi Daniels -
Number of replies: 2

I migrated my files to another partition, and now when I go in to edit a lesson, most of the lessons are editable, and there are a few that give me the message: "Can not read file, either file does not exist or there are permission problems". I can see the lesson, but I cannot edit it. Further, the students can still take the lesson, so this does not affect the course, but I need to edit the lessons. Help????


The error log showed nothing earlier, and now it is showing this:


[28-Jun-2015 15:27:27 America/Denver] Default exception handler: Sorry, the requested file could not be found Debug:
Error code: filenotfound
* line 463 of /lib/setuplib.php: moodle_exception thrown
* line 1964 of /lib/filelib.php: call to print_error()
* line 4611 of /lib/filelib.php: call to send_file_not_found()
* line 37 of /pluginfile.php: call to file_pluginfile()

Average of ratings: -
In reply to Wendi Daniels

Re: 2.8.3 Migrated to another partition, now files are lost

by Ken Task -
Picture of Particularly helpful Moodlers

Just love 'Moodlespeak' ...  maybe it's just me.   'Migration' how?   If on Linux from command line logged on as root user ... new 'partition' is /data.   moodledata used to be at /var/www/

If one did a cp command then one should have included the -rp parameters to cp command ... -r means recursive and the 'p' means preserve ownerships/permissions.

So: from /var/www: cp -rp moodledata /data/

Check ownerships/permissions on all files in filedir ... or better yet, just

cd /data/moodledata/

chown apache:apache ./filedir -R

The -R is recursive.   Command above assumes Linux on CentOS/RHEL/or Fedora family which typically uses 'apache' as the web server user and 'apache' as the web server group.

If another platform, then same thing.

Then try again.

See the lesson but not edit it still after above ... different story.   So student role can see the lesson and images (missing files)?    But Admin level user cannot?

If the file is truely missing (don't ask me how it's possible, dunno), then is that the piece that can't be edited an image inside a lesson?   Where in the lesson does this error appear?  Beginning ... or somewhere into the lesson?

Might have to resort to searching mdl_files to see if the image (file that is missing)  is there and that's if one knows it's humanly recognizable name + extension.

A screen shot might be nice ... in case am misundertanding.

'spirit of sharing', Ken

In reply to Wendi Daniels

Re: 2.8.3 Migrated to another partition, now files are lost

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

To slightly paraphrase Ken - if you moved 'moodledata' from one place to another and it didn't work then you did it wrong. There are some possibilities...

- are you **sure** it worked before (don't say 'yes' - prove it!)
- permissions (at **both** ends). Did you have the right permissions to copy the files from their original location and are the permissions still correct at the other end

- can you work 'copy'? It's not that hard, but did you copy the right folder and all its subfolders?
- config.php. Is the new setting in config.php for $CFG->dataroot really pointing to the right place?
- something else? On CentOS (for example), when everything obvious has been excluded then it's always SeLinux. May not apply to you unless you too have insane security software. 

That's all I can think of!