Upgrade to Moodle 2+ from 1.9 will break many resources. How to avoid this?

Upgrade to Moodle 2+ from 1.9 will break many resources. How to avoid this?

by Paul Nijbakker -
Number of replies: 9

Hi all,

Our main production site built up over seven years starting with Moodle 1.4 contains by now 124573 resources in over 5000 courses. Many of those resources are of the kind link to clusters of interlinked local course files, for example, (1) a Web page resource that links to a hot potatoes self-test that in turn links to sound files and/or pictures, or (2) a Link to a file (or website) resource that links to a miniwebsite with lots of pictures and interlinked pages, etc.

From what I have read and seen, the new file system in Moodle 2+ will break those resources. In the case of example 1 the web page will still link to the hotpot but the sound and pictures will be lost (and I haven't even figured out yet how to repair that, probably edit the hotpot to repace local links with direct links to the files in the Legacy course files. In the case of example two the index file of the site will still be linked but all the local links are broken. The solution suggested in the forums is to replace the File resource with a URL resource linking to the Index file.

Now, to avoid having to go through 5000+ courses fixing all these resources one by one, I wonder if anyone has any suggestions as to how I could resolve this (to me rather stressful) problem? I don't suppose there is a trick to turn all File resources into URL resources, or would that cause more problems than it solves?

Rgrds,
Paul.

Average of ratings: Useful (1)
In reply to Paul Nijbakker

Re: Upgrade to Moodle 2+ from 1.9 will break many resources. How to avoid this?

by sam marshall -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

I wasn't quite clear from your wording - have you actually tried this, i.e. does all this actually break when you run an upgrade on a test snapshot of your site?

I thought upgrade was supposed to handle this kind of thing, but I could be wrong as we didn't use upgrade for our system.

--sam

In reply to sam marshall

Re: Upgrade to Moodle 2+ from 1.9 will break many resources. How to avoid this?

by Paul Nijbakker -

Hi Sam,

I cannot say with certainty ALL. I have upgraded a small project site where there is not too much interlinked course material. Some material as described above does not work after the upgrade for the reason described, i.e. linked files are associated with the resource/activity and files with relative links to those linked files are not associated and hence those links do not work. For example, a Book page links to the index file of a mini website, the index file opens but pictures do not open and the links on the index page do not work. Opening the same index page in the Legacy course files the mini site works normally.

An interesting thing is that a file resource upgraded from 1.9 seems to work, while the same file resource in a course restored from a 1.9 backup does not work.

Rgrds,
Paul.

In reply to Paul Nijbakker

Re: Upgrade to Moodle 2+ from 1.9 will break many resources. How to avoid this?

by sam marshall -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Oh dear sad

At the OU we use a special custom-developed process (that I wrote) to convert from 1.9 to 2, because our 1.9 had lots of custom stuff that we need to change at the same time, and also because at the time I wrote it, the 'restore 1.9 backup' feature wasn't available. Unfortunately, it actually behaves in the same way you're describing - in that if an activity (like Book) links to a file, it will automatically assign the file to belong to that activity. Works great for images or Word documents or whatever, doesn't work at all for linked things.

Because the behaviour is the same, that suggests to me that the upgrade process might be using the same type of algorithm, and therefore it probably won't work. Is there any documentation for it, I wonder?

I can think of ways to programmatically fix this but they're horrible - I think you'd need to do a backup of the course (in 2.0 with the wrong links) and then some logic so that all the links which point to a file within an activity, are automatically changed to point to that same file within legacy course files (assuming it exists there). You might want to make it only do this for e.g. html files, so that it leaves the (probably correctly changed) files like images and videos etc alone. Anyhow, then restore the backup again. Reason for doing backup is this gets you all the data in one place (well in a bunch of xml files that you could reasonably search/replace through, in software)...

Or, you could try to hack the upgrade code to do that (before you do the upgrade) which might be easier.

By the way, we did have some issues with this here too. Where courses have these linked things, which is relatively rare, we're telling staff to manually put the related files into individual File objects for each activity. (Ideally, only the files that are actually used by the activity, or else the whole folder or whatever if that proves too complicated.) Seems like that is a more future-proof way of doing things than bundling everything together a la legacy course files, for example if we want to move individual activities between courses. Anyhow, not a good option if you have thousands of the things.

--sam

In reply to sam marshall

Re: Upgrade to Moodle 2+ from 1.9 will break many resources. How to avoid this?

by Paul Nijbakker -

Hi Sam,

Thanks for the suggestions, most of it sounds out of my league, but I can try associating more files to a file resource and see if that makes the interflinked resource files work.

However, this will not work for a file cluster linked to from, for example, a Book page. The link editor in the HTML editor does not allow for associating more than one file with one link (unless I am gravely mistaken).

Rgrds,
Paul.

In reply to Paul Nijbakker

Re: Upgrade to Moodle 2+ from 1.9 will break many resources. How to avoid this?

by sam marshall -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Yes you are basically correct - although in fact, the files associated with links in an editor box (like say this forum message, or probably a Book page - note I don't know anything about Book) are all stored in a single area: there isn't one area per link.

This means it might be theoretically possible to upload as many related files as you want into the file area for an editor box by using different (possibly hidden) links. But, for files added this way it forces download for security reasons, so you can't use this approach to serve link files. (At least this is true in forum, you could check book.)

I think for the files that have been linked from Book it is probably best to move them out of Book and into a File area along with the related files. You can then of course link to the File area (or a file within one) from the book. Don't know how you would go about doing this other than manually, I'm afraid.

--sam

In reply to sam marshall

Re: Upgrade to Moodle 2+ from 1.9 will break many resources. How to avoid this?

by Verna Jarvis -

We have tried both upgrading and using backup and restore on individual courses between 1.9 and 2.0 and have found that any of our resources that have links to an index.html file only keep that single file association. All of the other required files are still in the Legacy Course Files but are no longer associated.

We've also had problems with graphic links breaking.

In reply to Verna Jarvis

Re: Upgrade to Moodle 2+ from 1.9 will break many resources. How to avoid this?

by Polly Graser -

Hi There,

I am trying to learn from everyone's pain points around upgrading from Moodle 1.9.9 to 2.0. On the one hand M2.0 is very attactive on the other it seems like the migration of old courses to the new environment is a minefield.

I orginally came here to double check on some advise I was given about how to upgrade but now I have more concerns then before.

Can anyone help me with the following"

I think I would like to do the upgrade, but I was advised that I need to first upgrade from 1.9.9 to 1.9.13 then to 2.0.

For me this is not very attractive for several reasons. Extended downtime for my users and a double migration of courses past and present as well as double testing on even the old courses with old learner content.

If I read these forums I amost think it might be a better approach to start off from scratch with an empty M2.0 and migrate in the running courses and the soon to be running courses as needed like an assembly line. If I understand what other's have mentioned from similar experiences, student uploaded course material comes out funny on in the new version and requires tweaking.

Can anyone tell me do I really have to do a version jump 2times before getting to 2.0?

Isn't there a better way to do this-meaning less impact to my running courses and less testing for my teachers post migration?

Thank you,

Babette

In reply to Polly Graser

Re: Upgrade to Moodle 2+ from 1.9 will break many resources. How to avoid this?

by Janak Sodha -

Do not upgrade unless you wish to loose all your hair.  The file system in moodle 2 is invisible.