GIF file references corrupted by Backup & Restore to new course

GIF file references corrupted by Backup & Restore to new course

by Mike King -
Number of replies: 0

There were about 14 diagrams embedded in the text of the pages of a number of lessons.  All diagrams displayed correctly when using the original course (the 'Master' course).

The Master course was then backed up and restored to a new course.  When using the new course.  None of the diagrams were visible.

On examination of the html form of the text in the lesson pages of the new course, it was noticed that the relevant string embedded in the text was src="http://xxxxxxxxxxxxx/file.php?file=/2/FMO_Service_Layer_Switched_Services.GIF".

A separate examination of the directory structure under MoodleData, revealed that whereas originally, before backup & restore, there was a subdirectory called 2 containing the GIF files, there was now also a subdirectory called 12, and that all the GIF files had been copied from directory 1 to directory 12.  i.e. the files were now in both directories.

Then an examination of the underlying Moodle tables showed that the id of the Master course was 2 and that the id of the new course was 12.

One can guess that Moodle is matching its directory structures to the courses.

This then seems to explain why the GIF diagrams were not visible.
The new course with id 12 expects to look only in subdirectory 12 for the GIF files, but the restore process has NOT changed the file references appropriately as evidenced by src="http://xxxxxxxxxxxxx/file.php?file=/2/FMO_Service_Layer_Switched_Services.GIF" where the '/2/' still references a directory associated with the Master course.

I then changed all references to '/2/' in the new course to '/12/' and the diagrams all became visible.

Please will someone record this as an issue so that corrections can be made (or please tell me if I am wrong).

Thanks,

Mike King

Average of ratings: -