Issue with mdl_files and Scorm package for Moodle v3.5

Issue with mdl_files and Scorm package for Moodle v3.5

by Steve Ba -
Number of replies: 4

Hi,

We have been using Moodle v3.0, and we found v3.5 will be useful for other purposes, so we installed Moodle v3.5 and made other changes (courses, categories, theme, etc.). When we create courses and categories, we made all ids match as v3.0, and everything was working fine.


However, after we imported/appended below data, some courses are missing Scorm package, and doesn't display the course video.

Imported: mdl_cohort, mdl_cohort_member, mdl_enrol, mdl_event, mdl_role_assignments, all user tables

Appended: context users from mdl_context


I checked mdl_files, mdl_context, mdl_course_modules, mdl_course, mdl_scorm, and everything looks fine except mdl_file table has many duplicated records for same filename (ex: CC_001.zip). The component, "mod_scorm",  is not duplicated, but the component, "user" has 12 records for same contenthash and filename. I also checked src, and it has /mod/scrom/loadSCO.php?a=12&scoid=24&currentorg=videoname&mode=&attempt=1. It seems like "a" is id of mdl_scorm table, but I am not sure what "scoid" is.


Can someone please help me to understand how mdl_file table is working with the Scrom package (.zip file)? I have been looking into it for so long, but I cannot understand how it's working. BTW, we have about 70 files, already uploaded to the server, and most of them are not working. If it's not related with mdl_file table, please let me know what I need to check.


Please let me know if you need more information.


Thanks!

Average of ratings: -
In reply to Steve Ba

Re: Issue with mdl_files and Scorm package for Moodle v3.5

by Ken Task -
Picture of Particularly helpful Moodlers

This response not going to attempt to explain what is very difficult to understand description as I've never seen any official Moodle docs or forum discussions that recommend/show how to do what you're doing nor any good reason as to why!!! smile

So is there a reason?

Anothter question ... why not upgrade the 3.0 (using git if  on Linux) and just 'march' the moodle code upwards to desired 3.5.highest version one hop version at a time?

Sounds like a lot but it isn't ... and will take probably 30 minutes to upgrade at each hop upwards ... more time to check site and make code + DB backups before the next hop upwards.

And a little longer for upgrading the PHP and DB version as well for appropriate versions of Moodle.

moodledata and the files in filedir won't change signficantly ... users won't change ... don't think their cohorts will change ... course categories and courses contained therein + content of those courses won't change nor disappear.   As long as your SCORM's are no longer using shockwave flash ... should be ok with SCORM content in courses.

'spirit of sharing', Ken

In reply to Ken Task

Re: Re: Issue with mdl_files and Scorm package for Moodle v3.5

by Steve Ba -
Thanks for quick response.

To give you more information, we are changing domain, database server (MS SQL to Postgres), and Moodle version at the same time. For doing that, we installed Moodle v3.5 with some plugins on new server, made all design changes, and added new category/courses (with same IDs as existing version). Everything was working at that time, but once we migrated some data (as explained above), some videos (scorm) are not working even though I am able to download zip files. So far, we didn't find any other problems except that.

We did same steps on acceptance environment, and videos are working fine. We also removed videos (.zip), saved them, and re-uploaded videos on production server, but it's still not working.

I'm still new for this, so please give me advice.

Thanks.
In reply to Steve Ba

Re: Re: Re: Issue with mdl_files and Scorm package for Moodle v3.5

by Ken Task -
Picture of Particularly helpful Moodlers

Ok, we have just a little more information now ... even though avoiding
answering what platform ... OS.  Would make a difference.
Here's official moodle docs on Migrations
https://docs.moodle.org/37/en/Moodle_migration
You'll note Other considerations
Upgrade Moodle at the same time?
and that most of the examples given are linux commands.

Comments: even if you did the same steps on a test environment
one would have to begin with a fresh clone of production.

Why not working ... zips are used to upload SCORMS.
SCORMS contain the videos.  But I'll answer one ... scoid is a scorm ID.
The zips are extracted and meta data is used when actually displaying
the SCORM ... what you are saying videos.  Lots of meta-data in mdl_files that point to contenthash ... which are the actual filenames in moodledata/filedir/.  Only by extracting a SCORM zip to see what files were contained therein, then comparing what is in mdl_files to see if there is an .mp4 video plus other files necessary to 'play' a SCORM would one know.


Think you'll need to compare mdl_files table dumps with diff to see
how many differences there are ... here again, dump/diff are linux kinda things.

To be 100% honest, think the only persons who could respond to your questions considering the method used to migrate by directly manipulating tables would be a Moodle Partner or persons at that level.

'SoS', Ken

In reply to Steve Ba

Re: Re: Re: Issue with mdl_files and Scorm package for Moodle v3.5

by Ken Task -
Picture of Particularly helpful Moodlers

On thinking about the issue, wonder if you wouldn't try something ...

In the 3.0 instance, pick a representative course that has SCORM/Videos that work/play and make a full backup ... includes users, all resources.  Backups do NOT use .sql for DB info but XML.  Upon restore of a backup XML converted to SQL.

Take that backup and restore it to the 3.5.x.  Now when you restore bring it in as a new course ... don't try to replace what's there.   Do put it into the same category ... let moodle decide the course name to have 'copy' at then end of the course name.   That makes it easier for you to know differences in courses.

See if the restored course works or not.

If it does, great!   But then you probably need to undo whatever you imported table wise.   Too massive and very prone to human error if you are not a DB 'guru'.

How many courses does your site have?

Again, is the new hosting Linux or not?  If so, what distro?

IF the restore works, then there is your path/process, but suggest wiping out the 3.5 you have, install a fresh 3.5 with only categories setup so that when importing backups one can place courses back into the same categories.

If linux, one can restore multiple backups to a category using a command line utility called moosh.  I have moved a site of over 4000 courses into 20 categories (new site affectively a clone of the old) via command line using the backup.php script in old code, copying the .mbz files to new server in a file system on new server, then moosh to restore all the courses meant for a category.   NO issues with those course restores.

'SoS', Ken