restoring moodledata folder

restoring moodledata folder

by Nathan Bruley -
Number of replies: 5

I'm using Moodle 2.6.3

I accidentally deleted files in my moodledata folder. I'm wondering if I can restore files from a previous backup to that folder and leave everything else untouched (even though changes may have happened in the meantime) or what problems I might run into by simply adding files from a backup.

Is it better to just do a full restore to a previous date and live with the lost data?

Average of ratings: -
In reply to Nathan Bruley

Re: restoring moodledata folder

by Nathan Bruley -

I should mention that I also got the error "Can not read file, either file does not exist or there are permission problems" when trying to edit wiki entries and I could not rsync to a backup server due to an error "some files/attrs were not transferred (see previous errors) (code 23) at main.c(1070) [sender=3.0.9]-- I'm not sure if those issues would be fixed by copying in missing moodledata files or not... 

Also, since the deletion, the CPU has been running at nearly 100%.

Even changes to theme result in error "Coding error detected, it must be fixed by a programmer: Failed to unserialise data from file. Either failed to read, or failed to write."

In reply to Nathan Bruley

Re: restoring moodledata folder

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Someone will probably disagree with me, but as long as you have solid backups (which it sounds like you do), I would try it and see!  The database references should still be intact and returning the files may well resolve your issues.

Do a separate backup of the folder that you are copying too first, just in case.  Worse case scenario, it doesn't work and you still have the full backup option.

In reply to Emma Richardson

Re: restoring moodledata folder

by Nathan Bruley -

Thanks-- any idea if I need to worry about keeping special permissions or attributes?

In reply to Emma Richardson

Re: restoring moodledata folder

by Nathan Bruley -
I restored the missing moodledata/filedir files via ftp and it appears to have resolved the issue. I also deleted the moodledata session files just in case that would help resolve errors I was getting.