Invalid backup creation on moodle 3.3

Invalid backup creation on moodle 3.3

by Swaggaaa Yolo -
Number of replies: 4

Hello,

I've been upgrading a couple courses from moodle 1.9 to 3.3 following a lot of middle steps. All the backups have been successful and I've restored them up to 3.3 as I wanted, the only problem that I'm facing is that when backing up one of those course on moodle 3.3, the file created seems "corrupted".

Whenever I try to restore a 3.3 course backup, this is the error that I get:





Also, during the restore procedure, I can clearly see that some of the information is indeed corrupted:


As you can see, there are like "empty" files with no title or anything.

I tried extracting the backup and I compared it with a 2.8 backup of the same course. The file "files.xml" seems to lack some information on the 3.3 backup as you can see the difference here:




If anybody has any idea of why is this happening, I'd appreciate it a lot. Thank you for your time.

Average of ratings: -
In reply to Swaggaaa Yolo

Re: Invalid backup creation on moodle 3.3

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

See if enabling the Legacy File repository will help...

In reply to Swaggaaa Yolo

Re: Invalid backup creation on moodle 3.3

by Ken Task -
Picture of Particularly helpful Moodlers

+1 to Emma's suggestion ... but add or think that Legacy needs to be turned on not only at site level but in the problem course.

If I were you, I'd start working on courses that have legacy moved to courses that don't require legacy at all.

There is a plugin call 'poof'

https://github.com/justinhunt/moodle-tinymce_poof

as you can see it's for use with TinyMCE editor and one has to edit each single item ... lots of singles/clicks, etc.

If that's too much work (many courses), one might try something I put together for 'poofing' and entire backup of course but it involves bash shell/cli for it to work - ie, no Moodle interface for it.   After 'clipoofing', the course is rid of legacy *IF* the files in the course didn't use something as 'work-arounds' (which one could do back in the days of 1.9's).

Moodle forum:

https://moodle.org/mod/forum/discuss.php?d=350435&parent=1414497

Google Share info:

https://drive.google.com/drive/folders/0B5gmU8YqbNJQVFN4eUNiNHp0dWs

CliPoof, may/may NOT work for you .... too many variables involved. :\

'spirit of sharing', Ken

In reply to Ken Task

Re: Invalid backup creation on moodle 3.3

by Ken Task -
Picture of Particularly helpful Moodlers

Just thought of something else that might be involved.   Can't re-call what version of 2 where 'aliased' was introduced but, if in the old/site version, file system repo was turned on, and folders/files were uploaded to one of those file system repos, then linked in the course, there was an option *not* to copy those files into the new file system, but 'alias' them.     Files stayed in the folder of moodledata/repository/'somefolder' and the links to them were 'different'.

What one sees in the Moodle interface is merely 'meta data' ... like what a folder resource is called ... noticed those were in one of those files.xml comparison screen shots ... as well as entries for a '.' ... which is/was normal in some cases.

The above plus 'legacy' is kinda double trouble and worth the efforts to rid the course of not only 'legacy' but any 'aliased' to file system repos entries - if one wants the course to move upwards with Moodle versions ... *me thinks*.

Confusing, huh? :\

'spirit of sharing', Ken


In reply to Ken Task

Re: Invalid backup creation on moodle 3.3

by Swaggaaa Yolo -

First of all, thank you both Ken and Emma for your suggestions. I appreciate the help.

I tried enabling the Legacy File repository but the issue persisted. I was about to try Ken's answer but I found out finally what was causing the issue!

Recently we have added the "2.0 backup and restore" functionality no a custom plugin that we have and there was a mistake in it. One regex statement wasn't written correctly and it caused all those errors in the backups. Once I fixed that, everything started working again!

I'll probably try now that I've recovered the courses to 3.3, removing its legacy contents so it is up to date with the current moodle implementation.


Thanks both of you for your help! I hope somebody can benefit from this in the future.

Average of ratings: Useful (1)