Can I disable the Legacy Course Files Repository on an upgraded Moodle site

Can I disable the Legacy Course Files Repository on an upgraded Moodle site

by Fred Weiss -
Number of replies: 17

I have upgraded our 1.9 server to Moodle 2.1.   After a few hiccups all seems to be pretty OK now.

I am just a little confused about legacy files.  At the moment I have them enabled but hidden.

  • It does not appear as an option in the file picker or the course admin menu for new courses.
  • It does not appear as an option in the file picker on the migrated 1.9 courses.
  • However, it does appear as an option on the course admin menu for the migrated 1.9 courses.

 I don’t want the teachers to use it but if I select disable there is a fairly omnious warning  - Are you sure you want to remove this repository plugin, its options and all of its instances - Legacy course files? 

I obviously want to keep all of the files and the links to them in the courses. 

My question if I disable Legacy repository will the 1.9 courses retain all of their files and their links or do I need to leave legacy course file repository enabled & hidden?   

Thanks

 

 

 

 

 

 

 

Attachment Migrated course with Legacy course files link visible.jpg
Average of ratings: -
In reply to Fred Weiss

Re: Can I disable the Legacy Course Files Repository on an upgraded Moodle site

by Ken Task -
Picture of Particularly helpful Moodlers

If you have a way to browse the moodledata folder -> filesdir you'll see there are numbered folders in there - those are the old course ID folders and I'll bet there is very little in them any longer.

However, probably wise to be safe sooooooo ...

Backup the entire site first - including the webroot files, the data folder, and an sql dump of the database (something one should do anyway).

Set up Automated Backups - System Admin menu -> Courses -> Backups -> Automated Backup and select the option for Automated backup storage to 'Course Backup area AND the specified directory'

Run Cron.  Check to see if there are backups in the specified directory - the course backups in the specified directory will be something like:

-rw-rw-rw- 1 root root  10460106 Oct 13 01:43 backup-moodle2-course-11-20111013-0143.mbz

Now that you've a backup of the site and all courses both inside the 'new home' for files and outside the 'new home' for files in Moodle, now one could turn off legacy files in one course to see the affects knowing one has a backups of everything (just in case).

'spirit of sharing', Ken

In reply to Ken Task

Re: Can I disable the Legacy Course Files Repository on an upgraded Moodle site

by Fred Weiss -

Thanks Ken

I did the backup and DIASBLED legace course files under

Site Administration -> Plugins -> Repositories

It does not appear in any new courses but

exisitng courses with legacy files still have the folder visible at the course level (see image above) and Under Course administration -> Edit Settings -> Legacy course files Yes/No still appears.

I am wondering if this Is the correct behaviour or do I need to turn off elswhere.

 

Tks

Attachment Legacy course files.jpg
In reply to Fred Weiss

Re: Can I disable the Legacy Course Files Repository on an upgraded Moodle site

by Ken Task -
Picture of Particularly helpful Moodlers

Because you've apparently upgraded a 1.9 to a 2.x 'in place', all the courses had the Legacy (which really isn't 'legacy' behavior) turned on by default.  Go into each course and tell the course NOT to show legacy.  Moodle will not 'back-track' to courses that already exist but the 'no legacy' should be in affect for all NEW courses created from this time forward.

'spirit of sharing', Ken

In reply to Ken Task

Re: Can I disable the Legacy Course Files Repository on an upgraded Moodle site

by David Bogner -
Picture of Core developers Picture of Plugin developers

Hi,

I have a similar problem. On a fresh 2.1.2 install, after adding some 1.9 courses via restore, there is a "legay site files" folder on the frontpage. I can't get rid of it. Already disabled legacy course files repository, but can't change settings for the frontpage.

Any help is appreciated.

Best regards,

David

In reply to David Bogner

Re: Can I disable the Legacy Course Files Repository on an upgraded Moodle site

by Pete MacKichan -

Hi David,

I have exactly the same problem in 2.2 - I have deleted all the files in the legacy folders and removed the folders from the courses. I cannot, however, remove the folder from the front page. Did you find a solution?

Cheers,

Pete

In reply to Ken Task

Re: Can I disable the Legacy Course Files Repository on an upgraded Moodle site

by Monica Bokos -

Hi,

I had this crazy  idea that if I back-uped a course on a upgraded 2. x Moodle and restored it to a clean Moodle 2.x the legacy course files would dissapear. But nope. Did I misunderstand something? I will always keep legacy course files for old courses?

Thanks,

In reply to Monica Bokos

Re: Can I disable the Legacy Course Files Repository on an upgraded Moodle site

by Derek Chirnside -

Monica, did you find the answer to this?

-Derek

In reply to Derek Chirnside

Re: Can I disable the Legacy Course Files Repository on an upgraded Moodle site

by Alexandra P -

I also have a question regarding Legacy files. 

I`d like to know if it`s okay to delete them, and if so, is there a way to delete them all at once (or is deleting them one by one our only option)? 

 

Also, how can we hide the Legacy link option from the course settings (so teachers don`t accidently activate the link).

Thank-you

In reply to Alexandra P

Re: Can I disable the Legacy Course Files Repository on an upgraded Moodle site

by Derek Chirnside -

Alexandra, I tried to hide the legacy courses option in course settings yesterday in a course in 2.2.  Couldn't do it.

I had imported a small 1.9 course into a 2.2 site.  Legacy files came with it.  I had switched off Legacy files at course level. No difference.

I've not had too good a run with legacy files, or finding anyone who can be really definative.  See docs.moodle.org/22/en/Legacy_course_files

It looks like Monica, Pete, Ken and Fred have found what happens: once there is a legacy files section with a course you cannot get rid of it.  As to whether this is a feature or a bug, I am not sure.

Like Monica I expected to backup a Moodle 2.2 course and find in the backup NO legacy files.  AFAIK, from experiment, this is not the case.

-Derek

In reply to Derek Chirnside

Re: Can I disable the Legacy Course Files Repository on an upgraded Moodle site

by Alexandra P -

Hi Derek,

Thank-you for checking that out.

Do you know if it`s okay to manually delete the legacy files?  (I`m assuming that the files appearing in the course won`t be affected.)

Also, if you don`t delete the files but just hide the link, will these hidden legacy files affect any Moodle functions?  (For example, when doing backups)

Thanks !

In reply to Alexandra P

Re: Can I disable the Legacy Course Files Repository on an upgraded Moodle site

by Steve Bond -

Hello all,

In the Moodle 2 database, the legacy course files availability for a course is controlled by the field 'legacyfiles' in mdl_course. This appears to have 3 values:

  • 0 - legacy files disabled, and no legacy files option in settings
  • 1 - legacy files disabled, but can be turned on via settings
  • 2 - legacy files enabled

When you restore a course from Moodle 1.9, or do an in-place upgrade, it sets the value to 2, and then you can only change it to 1 via the course settings. But you could go into the database and change it to 0 manually, and then the legacy course files option disappears altogether.

I think this is what we will be doing for all our courses after upgrade.

Steve

In reply to Steve Bond

Re: Can I disable the Legacy Course Files Repository on an upgraded Moodle site

by Alexandra P -

Hello Steve,

Coule disabling the legacy files option have a negative impact anywhere on the system ?  For example, could it create a bug ?

Also do you know if it`s okay to delete the legacy files? 

We are upgrading from 1.9 to 2.1 and I`m wondering if these legacy files can cause problems even if the option is hidden. For example, when doing a course backup.

Thank-you

In reply to Alexandra P

Re: Can I disable the Legacy Course Files Repository on an upgraded Moodle site

by Steve Bond -

Hi Alexandra,

Yes, it could cause a problem, there is one mentioned on the Tracker: http://tracker.moodle.org/browse/MDL-32601 whereby hyperlinks from HTML/Moodle pages to uploaded files stop working once Legacy is turned off.

I can't imagine it would cause any problems with resources that are linked to the course home page.

I don't think we have very many of these second-order links on our server, so not expecting a major problem. We'll be keeping a copy of 1.9 running in any case, so any missing files can be easily restored.

I'm afraid I don't know whether deleting the legacy files is OK (if you don't need to save disk space then I wouldn't bother), nor do I know whether Legacy files cause backup problems (I don't see any open issues on Tracker, but there is one about importing: http://tracker.moodle.org/browse/MDL-25631).

Steve

In reply to Alexandra P

Re: Can I disable the Legacy Course Files Repository on an upgraded Moodle site

by Michael Woods -
Picture of Core developers

Yes, disabling legacy course files can have a negative impact (http://tracker.moodle.org/browse/MDL-32601 was the tracker I created for this topic).

IMHO, It's disappointing that those who had embedded images into course topics (via section summary or labels) woud have all their images break if legacy files is disabled for the course. That means, in reality, we are stuck with legacy files in each of our upgraded courses until such time as all dependent files have been shifted into another repository (server files, alfresco etc...).

I agree with other posters here that there has not been enough discussion about this topic from people who really understand it. It's not a problem for fresh 2.x installs, but a farily major consideration for large 1.9 upgrades.

In reply to Michael Woods

Re: Can I disable the Legacy Course Files Repository on an upgraded Moodle site

by Alexandra P -

Hello Michael,

Thanks for the update. 

Does  any information exist on how to shift the legacy files into another repository?  And once these files are moved, then the legacy file option can be removed without causing any image breaks or other problems?

 

In reply to Alexandra P

Re: Can I disable the Legacy Course Files Repository on an upgraded Moodle site

by Michael Woods -
Picture of Core developers

Hi Alexandra,

I don't think there is an automated method, if that is what you are asking. Our college is introducing Alfresco as our main repository, and we would expect that staff would begin to migrate their old legacy files over to Alfresco and re-link them over time. 

For the time being, at least the legacy files are there and nothing is broken. The good thing is that people can't add more files to legacy going forward, so the problem can't get worse.

I hope this is somehow helpful to you.

Regards,
Michael

In reply to Alexandra P

Re: Can I disable the Legacy Course Files Repository on an upgraded Moodle site

by Derek Chirnside -

I'm sorry for taking so long in replying.

I have had to put this on the back burner.

For some reasons, seemingly overnight, one of our servers nearly doubled it's total disk space to 64 GIG and I cannot find out why.  There are several interconnecting factors:

  1. There are no limits to uploads of some sorts of files.
  2. I cannot find out where the files are and what type of file they are
  3. Out hoster has found a bug (bugs) in the report.

I've tried to add to the docs here: http://docs.moodle.org/22/en/Legacy_course_files but I lost track of exactly what I did, and was reluctant to be definative.

I'm hoping once 2.3 is out the door to talk with someone who knows from MoodleHQ.

Unfinsished.  Coffee and commute calls.

-Derek