Legacy Course Files when restoring from v1.9

Legacy Course Files when restoring from v1.9

by Donna Hrynkiw -
Number of replies: 5

Just for the information of the community (because we've spent the last couple of days thrashing through this issue and want to save you the same effort):

When you restore

  • a v1.9 course backup archive
  • to an EXISTING v2.1 course
  • choosing "delete the contents of this course" (don't know if this is significant or not)

The Legacy course files area is NOT created

 

When you restore

  • a v1.9 course backup archive to v2.1
  • selecting "Restore as a NEW course"

The Legacy course files area IS created.

Average of ratings: Useful (4)
In reply to Donna Hrynkiw

Re: Legacy Course Files when restoring from v1.9

by Paula Clough -

Thank you.   Just tested on our new site and we are finding the same thing as of this date.

Paulacool

In reply to Donna Hrynkiw

Re: Legacy Course Files when restoring from v1.9

by Amy Call -

Thanks Donna.  We are also finding that if you restore the 1.9 course into a new course on your 2.0 site that Legacy files are intact.  However, if you backup the course in your 2.0 site with the legacy files and try to restore to an existing course choosing to delete the contents of the course then the legacy files are removed.  It even turns off legacy files in the course settings.  Not finding a bug on this yet and if I don't find one I'll create one. 

In reply to Amy Call

Re: Legacy Course Files when restoring from v1.9

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

The issue is that the '$this->add_related_files('course', 'legacy', null);' function call is done as part of the 'course_info' step. The 'course_info' step is only executed (during restore to existing file) if the 'overwrite existing course information' option is selected (I can't remember the exact wording of this option).

I have implemented a fix for this, on one site, but it basically involves creating an extra 'restore_course_files_step' and doing the 'add_related_files' call within that. I'll double-check, but I suspect I will be able to release the fix I created as a patch, if you create a tracker issue to attach it to.

In reply to Davo Smith

Re: Legacy Course Files when restoring from v1.9

by Amy Call -
Thanks Davo! I have searched through trackers and have found some similar but not exact issues. I will create a tracker as soon as I can and then post the info here. Thanks again.