Upgrade 1.9.x to 2.3.2+

Re: Upgrade 1.9.x to 2.3.2+

by Ken Task -
Number of replies: 2
Picture of Particularly helpful Moodlers

Not that you need any more advice, but maybe a brief explanation is in order ...

In 1.9.x data folder there were course ID folders and all files related to a course could be found in there.  That is no longer the case in version 2 of Moodle.  Now, all files are hashed named and placed in 'filedir' of the data folder.  The migration doesn't handle metadata folders in the course ID folders - user icons - and may as well clean up files in backupdata - those are 1.9 backups and won't serve any purpose in mirgration.  Might also reset ALL courses ... users won't migrate anyway and resetting courses also removes assignments which might be files uploaded by users.

Here's kinda what filedir looks like now (no course ID folders):

[root@sos filedir]# ls
01  0b  1a  2a  38  46  55  71  7c  98  ab  b4  ce  e2  warning.txt
02  0e  1d  30  3a  4e  5d  72  7d  a1  ad  b6  d1  e5
09  0f  1e  32  40  4f  63  78  7f  a3  b1  c6  d5  ed
0a  10  23  37  42  54  67  7b  89  a9  b2  c9  da  fb

Files uploaded (or migrated in your case) are recorded in the DB with a contenthash and pathnamehash in the mdl_files table and the 'physical filename' is changed to a hash named file with no extension.

Example of '01' directory above:

[root@sos filedir]# ls -lR 01
01:
total 4
drwxrwxrwx 2 apache apache 4096 Jul 24 21:39 3e

01/3e:
total 4
-rw-rw-rw- 1 apache apache 2119 Jul 24 21:39 013ee7039a7ec06834ecd2798d99cb210aeaa5ab

This:

013ee7039a7ec06834ecd2798d99cb210aeaa5ab

is actually a file by hashname and it is a PNG graphic.

head -n 1 013ee7039a7ec06834ecd2798d99cb210aeaa5ab

will show: ?PNG

So files are physically there, but not by any re-cognizable name (ie, as they were uploaded).

There could be remaining some course ID folders in moodledata ... those will probably contain a metadata folder and one might find an assignments folder also there ... with numbered folders which were assignment ID numbers and numbered folders contained therein - which were the folders for the student by id number.  This from memory and 2.3 might have gotten better about cleaning up junk it can't use.

Just one piece of advice on your next attempt at migrating ... clean up a copy of the 1.9 ... *throughly* - not only DB but any add-on, all course backups in backupdata, any 3rd party add-on mod or block.  Make it as bare bones as you can with 'stock' or 'core' Moodle.

In your second post one can see a warning that certain blocks IF they had changed permissions might cause issues.

From personal experience at a migration, I eventually removed many visiable blocks from front page, from courses, and removed any add-on known NOT to have made the 'trip to 2', etc. before attempting migration.  Increase variables for php and even for MySQL.

Eventually, was successful ... although still ended up with the dreaded 'Legacy file system' active not only on the front page but in every course as well.

It's a challenge ... but along the journey one will learn a little more about what makes version 2 tick (something we unfortunately/fortunately) did not have to learn with previous versions of Moodle (until forced to).

'spirit of sharing', Ken

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

Re: Upgrade 1.9.x to 2.3.2+

by Chetan Sharma -

Hi Ken,

In starting i had a URL for my course as:

pluginfile.php/166/mod_resource/content/2/main.html

But when i replace even a single file and save the course it changes to:

pluginfile.php/166/mod_resource/content/3/main.html


Can this content/2 to content/3 be avoided. I want the same URL.


Thanks in Advance.



In reply to Chetan Sharma

Re: Upgrade 1.9.x to 2.3.2+

by Ken Task -
Picture of Particularly helpful Moodlers

@Chetan Sharma

First, suggest starting your own thread ... your migration from 1.9.x to 2.3.x it appears to have been successful and your issue now is with something else ... mini site inside Moodle?, a SCORM package?, a whatever? ...  however, be specific in description ... include what main.html is.

Your specific problem deserves it's own attention/thread ... otherwise it's buried under a topic which may/may no longer relate.

'spirit of sharing', Ken