Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Daniel Rodriguez -
Number of replies: 29

Hi fellos,

We have migrated Moodle 1.9 to version 3.7 and in general everything has worked correctly, however, we have a problem with the assignment files in the existing courses. Basically in the new version the assignments are not seen in the assignments module even if the files are in the corresponding folder.

How can we do so that the previously existing assignments are seen in the assignments module in this new version?

We appreciate your urgent help in advance.

Daniel

Average of ratings: -
In reply to Daniel Rodriguez

Re: Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Assignment was completely replaced - if I remember correctly - in version 2.2. There was a migration script you were supposed to run. The tool was removed in 3.6 I think.
Average of ratings: Useful (1)
In reply to Howard Miller

Re: Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Daniel Rodriguez -
Thanks Howard. We already try that migration tool once we had the 3.7 version running. It didn't solved the situation.
In reply to Daniel Rodriguez

Re: Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
You marched a Moodle release 1.9 all the way to release 3.7. When? Without taking breaks in between?

The assignment could very well be the dead end with 'Assignment (2.2)'. People had to switch to the new assignment type. I can't remember all the details, it is such a long time ago. May be some other person will refresh our memory.
In reply to Visvanath Ratnaweera

Re: Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Daniel Rodriguez -
Thanks Visvanath
In reply to Daniel Rodriguez

Re: Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Ken Task -
Picture of Particularly helpful Moodlers

This might not work, but given your situation, you might have upgraded past the point where you could convert old assignments into the new 'assign'.

Check what mod/addons show.   The old assignment mod might hidden.  Unhide it if it's there still.  Then check your site admin menu to see if there is a new link to convert old assignments to new assign.

If there is do it ... since your site might contain many many that need converting, you might have to limit the number of assignments to convert from max to something lower.   That means more clicks etc. but, hopefully, no issues.

Reminder ... said this might not work - but worth a shot!

'SoS', Ken




Average of ratings: Useful (1)
In reply to Ken Task

Re: Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
It's not. It's definitely all removed by 3.7
Average of ratings: Useful (2)
In reply to Howard Miller

Re: Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Ken Task -
Picture of Particularly helpful Moodlers

Yeah, my feeble fails!   You are 100% correct, Howard ... however ...

been my 'recent' experience it's not really 'all' removed! :\

Checked this AM.

Assignment Upgrade Helper is gone, but what's up with the actual Activity module?

Still present in Moodle 3.7.3+ (Build: 20191115) - git installed/updated.

Assignment 2.2 (Disabled) 2019052000

Why is it still present?

Kinda like Themes in version 2.6?  or there abouts where a bunch of themes never installed showed up after a git acquired update.

They kept showing up when checking what plugins needed updating. Only way to remove ... DB mdl_config_plugins.

So I un-installed the 'Assignment 2.2 (Disabled)'.
Removed the following tables:
assignment_offline
assignment_online
assignment_upload

assignment_uploadsingle
assignment

Came to the step of removing the folder and after clicking OK.
'Secure Connetion Failed!' error.
No panic ... Clicked Continue.
Sent to Plugins check page.
And 'Upgrade Moodle database now' available.

Finally eradicated.

** Also still present in a Moodle 3.8+ (Build: 20191129) fresh install.

So ... the bottom line is ... if one didn't upgrade assignments back when the "Upgrade Assignment Helper" button was available and hyperjumped to a version of Moodle that no longer supports nor has that code, OP/Admin user out of luck! :|

Any plugin/addon available for those users in such a predicament?

How about an admin/cli script?

'SoS', Ken


Average of ratings: Useful (1)
In reply to Ken Task

Re: Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
You're right. Now I'm confused....
In reply to Howard Miller

Re: Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Well, if the upgrade tool is still (3.8) dormant in the code, awakening it is for adventurers. The official advice is along the march route 1.9 -> 2.2 -> 2.7 take time to upgrade the old (2.2) assignments to the new format. See https://docs.moodle.org/27/en/Assignment_upgrade_tool.
In reply to Visvanath Ratnaweera

Re: Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Ken Task -
Picture of Particularly helpful Moodlers

Looks like it hung around for a while!

As late as 3.5??!!!

find ./moodle??/ -name assignmentupgrade
./moodle23//admin/tool/assignmentupgrade
./moodle24//admin/tool/assignmentupgrade
./moodle25//admin/tool/assignmentupgrade
./moodle26//admin/tool/assignmentupgrade
./moodle27//admin/tool/assignmentupgrade
./moodle28//admin/tool/assignmentupgrade
./moodle29//admin/tool/assignmentupgrade
./moodle30//admin/tool/assignmentupgrade
./moodle31//admin/tool/assignmentupgrade
./moodle32//admin/tool/assignmentupgrade
./moodle33//admin/tool/assignmentupgrade
./moodle34//admin/tool/assignmentupgrade
./moodle35//admin/tool/assignmentupgrade

'SoS', Ken

In reply to Ken Task

Re: Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
See here in the tracker: MDL-61041
In reply to Mary Cooch

Re: Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Ken Task -
Picture of Particularly helpful Moodlers

Thanks, Mary.

Still confused!

Have a site with active 3x's.  All fresh installs via git.

[root@sos html]# ls -ld moodle??
drwxr-xr-x. 54 apache apache 4096 Sep 19 08:10 moodle34
drwxr-xr-x. 53 apache apache 4096 Nov 11 15:30 moodle35
drwxr-xr-x. 53 apache apache 4096 Dec  8 00:22 moodle36
drwxr-xr-x. 54 apache apache 4096 Nov 16 07:19 moodle37
drwxr-xr-x. 55 apache apache 4096 Nov 29 10:40 moodle38

And assignmentupgrade tool is only in 34 and 35

find ./moodle??/ -name assignmentupgrade

./moodle34/admin/tool/assignmentupgrade
./moodle35/admin/tool/assignmentupgrade

but the mod directory/plugin for the old assignment called 2.2 (disabled) in the GUI and it's real directory is 'assignment' is still physically present:

find ./moodle??/ -name assignment
./moodle34/mod/assignment
./moodle35/mod/assignment
./moodle36/mod/assignment
./moodle38/mod/assignment

(except for the 37 above where I un-installed it)

When in GUI and going to Site administration->Plugins->Activity modules->Manage activities

of a 3.8+ (Build: 20191129)

Assignment 2.2 (Disabled) shows as hidden.

Why is it even present?  If one un-hides it, cannot use it in a course - attempts to use will beget an error that says it's not present.

And from the Tracker it appears to say that @Daniel's 'march' of his Moodle, all old assignments should have been converted to the new assign on the fly?

'SoS', Ken


In reply to Ken Task

Re: Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Sorry I can't help with the technical side - I only read the same as you - hopefully a dev and/or assignment upgrade expert will come along with more understanding soon.
In reply to Howard Miller

Re: Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Ken Task -
Picture of Particularly helpful Moodlers

Oh, no!  Say it ain't so!!! Confusion is my domain!  Someone needs not to be confused in here! smile

'SoS', Ken

In reply to Ken Task

Re: Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Daniel Rodriguez -
Thanks Ken. I guess that we will need to start again, upgrade from 1.9 to 2.2, then apply the assignments migration tool, then continue upgrading moodle upto 3.8.
In reply to Daniel Rodriguez

Re: Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
That would be my guess. I have done several of those upgrades though and have normally not had to actually run the tools - normally a later upgrade runs it automatically for you. Are you not showing any submission records or are the files just missing?
In reply to Emma Richardson

Re: Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Daniel Rodriguez -
Hi Emma. All the assigment's registers are there and those assigments were already calified, however, with the migration to 3.7 the files are missing at the user interface (even if they exist in the moodle data directory).
In reply to Daniel Rodriguez

Re: Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Daniel Rodriguez -
Emma, please see my answer to Ken below.
In reply to Daniel Rodriguez

Re: Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Ok, I would tend to agree with Ken then. Go back to 2.2 and run the manual migration - at that point check that assignments are all upgraded and showing files. Backup again. Move to 2.7 - check everything again - at this point you should have the old assignment disabled and just the new assignment running. Something must have glitched somewhere. Are the rest of the files on the site ok? Just checking it is an assignment issue and not a file migration issue...
In reply to Emma Richardson

Re: Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Daniel Rodriguez -
Emma, it is just with the assigment files. All the other things are fine.
In reply to Daniel Rodriguez

Re: Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Ken Task -
Picture of Particularly helpful Moodlers

Well, if presently @3.8 and no assignments show, then sounds like your only option.

Can re-call doing a site months ago (prior to 3.8) and stopping at a version along the march to use the upgrade tool.  Site was heavy in assignments and it took 2 hours to upgrade them.  Couldn't do defaulted 100 at a time.  Had to set to lower.

From what I saw in the tracker, supposed to do it on the fly now, but that's not been your case.

One thing I would advise if you've not been doing this ... at every step in the march, check site and if OK, take the time to do at least a DB dump and tar ball backup of code before next hop.

IF there is a hickup in a hop, don't have to begin again at the beginning.   Just restore previous known working site and research the issues before trying the next hop!

Virtual finger wag ...

don't wait so long to upgrade and one will have fewer issues upgrading! ;)

End Virtual finger wag!

'SoS', Ken

In reply to Ken Task

Re: Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Daniel Rodriguez -
Hi Ken,

Let me tell you the history. We started to upgrade the site from 1.9 to 2.2, then we upgrated that to 2.7, then to 3.2, at that moment the moodle upgrading tool said that the assigment module was obsolete and proceed to upgrade it, then we upgraded moodle to 3.7 and at the end we noted that the assigment files were missing at the interface as you can see at the attached image where the "File Sent" Column (Archivos Enviados) is empty.

So, what do you think, should I go back and start again from the beggining but using the separate migration tool once I have the 2.2 vesion??
In reply to Daniel Rodriguez

Re: Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Ken Task -
Picture of Particularly helpful Moodlers

The only way to really know is not by trusting the Moodle graphic interface ... even as admin level.

Query the mdl_files table.

Example:

mysql -u root -p -e "use moodle;select id,userid,filename,filesize,contenthash,component,filearea
from mdl_files;" > files.txt; cat files.txt; wc -l ./files.txt;ls -l *files.txt

You will see references like ... note that's like:

2587616    8933    Microplastic Invasion.pdf    submission_files    951457    assignsubmission_file

Pay attention to userid and component and filearea ... those disclose if file reference found in DB table is related to an assignment ... and maybe which mod ... new or old.

8933 above is a student ... go to that students dashboard and check courses for that student ... assignments and submission files.

Once that files.txt file is created, one can use fgrep 'term' files.txt to search/find stuff in it.

I can't be very specific with the query cause I no longer have access to a system that uses old assignments.

'SoS', Ken

In reply to Ken Task

Re: Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Daniel Rodriguez -
Hi Ken,

As commented, a query was made to the database having the result shown at the attached image.

There are many records with the name "backup.mbz" and making references to the recycle bin. In other words, the recycle bin is currently empty. What could motivate the fact that the archives of the previous tasks may have been written in the new version assigned as ‘recyclebin_course ’?

Attachment Captura.PNG
In reply to Daniel Rodriguez

Re: Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Ken Task -
Picture of Particularly helpful Moodlers

Purpose of the query was to discover IF there were any files in the area of assignment submissions.  Were there?

Did you see any rows like the example given previously?

According to what you've shared, the 'recyclebin' isn't 'empty' ... I see some backup.mbz's that have small sizes.  And they do reference a 'course'.

On your system, who (what account) is userid 5.  Is that user an admin level account? (no names please ... just the role of that user in your moodle).

Before those disappear (get moved to trashdir) see if they exist and what they are.

Take the contenthash of the first one in your listing.

1141bunchofotherlettersnumbers

Using ssh and logged on as root.

cd /path/to/moodledata/filedir/

find ./ -name 1141bunchofotherlettersnumbers

That command might take a long time depending upon site of filedir.

It should kick out:

/11/41/1141bunchofotherlettersnumbers

See if it's really a .mbz file (which is really a gzipp'd file:

file -b /11/41/1141bunchofotherlettersnumbers

should show: gzip compressed data, from Unix

To find out what's in it:

cp /11/41/1141bunchofotherlettersnumbers /tmp/

cd /tmp

mv 1141bunchofotherlettersnumbers some.mbz

tar tvf some.mbz

That should show contents of the .mbz file and the key file for any moodle backup is the presence of moodle_backup.xml

To extract just the moodle_backup.xml file if present:

tar -zxvf some.mbz moodle_backup.xml

Then

head -n 40 moodle_backup.xml

will give more info.

As your question ... unkown.   Have not a clue as to what happened.

Am trying to help you discover what you have.

'SoS', Ken

In reply to Daniel Rodriguez

Re: Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Ken Task -
Picture of Particularly helpful Moodlers

Followup ... just remembered ... back then (years ago) it was recommended that one upgrade the 1.9 to the highest point release in that series (1.9.20 if I re-call correctly).  Then do the first step/hop to 2.2.highest.

Anyhoo, think your best option is to start over! sad  Get to a version where that Assignment Upgrade tool showed in the site Admin menu and perform that.  Check site after.

If ok, then next hop.

'SoS', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Daniel Rodriguez -
Hi Ken, first of all, thanks for your support on this matter.

Secondly, most of the rows were as selected, belonging to the 'recyclebin'.

User 5 is an administrator, however, during the update he was NOT the responsible user.

We have reviewed and it is not a 'mbz' file, they all have a name without an extension such as '1e07b45827b960a9632a83a51e9f1e2bbb6c6073' in the folder '/filedir/1e/07'.

Your last comment seems logical to perform the update by stage and verify the assignment module and its files.
In reply to Daniel Rodriguez

Re: Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Ken Task -
Picture of Particularly helpful Moodlers

You could get a peak at contents of those files.

From your moodledata directory:

mimetype

file -b /filedir/1e/07/1e07b45827b960a9632a83a51e9f1e2bbb6c6073

Top 10 lines of file:

head -n 10 /filedir/1e/07/1e07b45827b960a9632a83a51e9f1e2bbb6c6073

The last will probably beep or look strange, but there might be something that ID's the file on the top lines of the file.

A DB query of mdl_files for contenthash,filename (other columns of your choice) where contenthash = 1e07b45827b960a9632a83a51e9f1e2bbb6c6073

Will show the metadata about that file.

'SoS', Ken

Average of ratings: Useful (1)
In reply to Daniel Rodriguez

Re: Assigment files not been shown at assigment module after 1.9 to 3.7 moodle upgrade

by Ken Task -
Picture of Particularly helpful Moodlers

About starting over .. now that moodledata/filedir/ has been altered you'll have to do original code, original DB, *and* original moodledata.

And, first step in this is to upgrade the 1.9.x to the highest 1.9 available before the first mass change going from 1.9.highest to 2.2.highest.

'SoS', Ken