Upgrade from 1.9.3 to latest

Upgrade from 1.9.3 to latest

by P.- Kok -
Number of replies: 11

Hi,


I am trying to check the upgrade process from 1.9.3 to the latest moodle version. The current moodle does not have any custom plugins or changes. The thing is that I haven't decided yet which is the best option for the upgrade process.


Is it just to install the new moodle version and then try to backup/restore courses,users,files (Is there anything like grades or sth that it will not be backed-up)?

Or perform the (not very easy I think) upgrade process to 2, then to 2.1 then to 3?

Average of ratings: -
In reply to P.- Kok

Re: Upgrade from 1.9.3 to latest

by Colin Fraser -
Picture of Documentation writers Picture of Testers

You are actually quite correct in your assumption that there needs to be a multiple upgrade process if you want to take your course into the new Moodle. Go from 1.9.3 to v1.9.19+ first. This will add changes to your v1.9.3 database that make it easier to make the next step up.

Then upgrade that to Moodle 2.2.11 This is the last legacy version of Moodle where you can make the transition with the courses and users database. It leaves it all intact while changing the database to accept the changes made to v2.x.x Moodles.   

Then upgrade to a more recent version such as 2.6.1 This is a mid-point, if you like, from v2.2.11 to your destination. 

Then upgrade to v3.x. The database should remain intact through this rather large change. 

Caution, or advice, or maybe teaching Grandma how to suck eggs, whichever way you see it...wide eyes  I seriously suggest you leave your current production Moodle where it is. Create a new server if you have to, or a new site on a different server or a new site on the same server, or anything that allows you to do the upgrade without really affecting your current production site. Copy your production site to the new site, making sure that all the addresses and everything are pointing to the new site, check your config.php file closely. Do your first upgrade, then test. If all is working, do the next upgrade and test. This is where it is most likely to fall over, which is why you want to not be working on your production site. Test thoroughly, everything you can think of, then assume you have missed something. Then upgrade and test until you get where you want to be. 

By this time, you are likely to have run into the issues of PHP not being the right version. The v5.x  PHP will, AFAIK, not be compatible with v3.x of Moodle, you may need to upgrade the PHP to v7.x...  So expect a bit of trouble along the way. 

As you are no doubt aware, this kind of thing causes much grief and angst and general mischief for any admin, so be patient and just take your time. Then you will have to look at your upgrade policy and accept that it is just not working for you. I only update once per year and that is sufficient for my client. It also means not too much work or other issues for me. Seriously suggest you think about it and not leave it for so long.  

(And all this is from a real fan of v1.9.xx still grieving about missing all those little idiosyncrasies that made Moodle such a joy to use...cool

Your only viable alternative is to start from scratch... Cheers.

Average of ratings: Useful (1)
In reply to Colin Fraser

Re: Upgrade from 1.9.3 to latest

by P.- Kok -

Thanks for your reply. It is very helpful.. Unfortunately the previous admin owner of my client left it to that version.. so.. hard work for me now..


Moreover I am really thinking of get a full backup courses, users, user data etc.. and Restore them to the latest moodle version. Will I miss anything? Will it be hard to backup/restore these data?

In reply to P.- Kok

Re: Upgrade from 1.9.3 to latest

by Colin Fraser -
Picture of Documentation writers Picture of Testers

No, not going to happen. Anything after v2.2.11 will not recognize any course from v1.9.x It will say the course is not a properly formed *.mbz file. Prior to v2.0, Backups were zip files, that changed after the database changed and while there is no significant difference between the compression formatting of either type of file, there are huge changes in the structure of the backups that render them unusable in the later versions of Moodle. After v2.6.x or so, there were, I understand, further changes to the database that make pre-v2.6 backups somewhat problematic, no idea why, but there have been some issues. 

The real problem is that the database has evolved from v1.9 to v2.0 now to v3.0 and there are significant shifts along the way. This is similar to changing from a v1.7 to a v1.9, you had to have a v1.8 in there, from what I can recall. 

Good luck... 

Oh..btw, you will need to go to the Legacy release page of the Moodle Download pages to get the versions you need. I suggest if you have a lot of courses, then read all the documentation closely before doing anything. There is also a number of Moodle Docs you can use to help you perform the updates. 

In reply to P.- Kok

Re: Upgrade from 1.9.3 to latest

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Actually, you can restore 1.9 files to higher versions but not with users.  If you need to keep your users, you have to go through the upgrade process.  

Average of ratings: Useful (1)
In reply to P.- Kok

Re: Upgrade from 1.9.3 to latest

by Ken Task -
Picture of Particularly helpful Moodlers

In addition to what's been said ... and an item that has not been mentioned yet ... when migrating a site (from 1.9.19 to 2.2.highest ->) one will retain users but the files contained in all courses are in 'legacy'.  Courses in legacy file system don't behave like new courses with new file system.  Once a course is in legacy, it's in legacy forever.   The same thing will happen when restoring a 1.9.x course - no users and legacy file system.  While it doesn't 'hurt' anything now, it might, in the future, when/if Moodle code no longer supports 'legacy'.

So your options are basically: 

migrate a site upwards (the 'moodle march') - one retains users but has legacy file system.   A 'moodle march' is best done via git    1.9.current -> 1.9.19+ -> 2.2.highest -> 2.3.highest -> 2.6.highest -> 2.7.highest -> 3.highest.  Reason for the 'pit stops' ...  to address major changes at that point.  If broken, fix at that point,, before marching upwards the next step. Examples: changes to assignment mod and quiz upgrade helper present first time in 2.3.x,   2.7 major change in themes if known can address at the 2.6 stage of the march.  Note: cannot say if done this way, 100% no issues as every site I've ever marched was different. :\

OR, rebuild courses in a fresh 3.highest.   Advantage of this ... there has been enough change to Moodle where a little re-training for teachers would be in order anyway.   Rebuilding courses would require re-learning and might result in arriving at destination in better shape (so to speak) ... might even cause teachers to re-think course design/methods, etc..

On going the option 2 route, teachers can re-acquire files contained in their 1.9.x old course by unzipping the backup and they can find their files by humanly re-cognizable names.

'spirit of sharing', Ken

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

Re: Upgrade from 1.9.3 to latest

by P.- Kok -

The problem is that I need the old courses with their moodle data on them..I have until now moved to 2.6 version but my old moodledata files do not exist. No errors aroused but the the files are missing and most of the courses are empty. How I can prevent this from happening?


Sth I haven't mentioned is that in moodledata folder I have now a filedir folder with some files encrypted like.. So the upgrade operation moved files over there? And if so then why the links from the courses' files do not work any more?


"This legacy resource type (file) was not yet migrated, sorry."

In reply to P.- Kok

Re: Upgrade from 1.9.3 to latest

by P.- Kok -

Basically apart from Quiz files all other uploaded files have not been migrated. "This legacy resource type (file) was not yet migrated, sorry."


What can I do?

In reply to P.- Kok

Re: Upgrade from 1.9.3 to latest

by Ken Task -
Picture of Particularly helpful Moodlers

Is legacy file system turned on in the Moodle to which you are restoring?

If not, turn it on.

Increase setting for PHP: time for script to run, memory each script can consume.   Also increase max_packet_allowed and open_files_limit in MySQL.   Change to PHP settings ... restart apache.  Change to MySQL settings, restart mysqld.

KKeep fingers crossed .. do magic incantation ... and TIA (try it again!).

'spirit of sharing', Ken


In reply to P.- Kok

Re: Upgrade from 1.9.3 to latest

by Colin Fraser -
Picture of Documentation writers Picture of Testers

At the v2.2.x, if the courses are backed up, then restored into the next version update, as Ken has suggested, what would happen? Would they be "legacy" or would they be v2.2.x backups?  

Or: 

To update those courses, can they be imported into newly created v2.2.x courses, then backed up into the new course format? Could they then be restored into the next updated version? 

Just ideas, which really seems to me to be a bit time consuming, if there are a lot of courses.... 


 

In reply to Colin Fraser

Re: Upgrade from 1.9.3 to latest

by Ken Task -
Picture of Particularly helpful Moodlers

Somone discovered a rather strange method of restoring 1.9 backups in which files were no longer tagged as legacy and the course used the new file system.   Had to have a version 2.3.lowerthanhighest (possibly a 2.2 would work).

Bascially it went like this ... create a blank course in the 2.3.   Then restore into the course just created a 1.9 backup into  the same course.

Have watched the process via command line and moodle first created a temp directory where it un-zipped the 1.9 backup, then ran through a routine to rebuild the backup directories/files in another temp directory, but this time it had a moodle_backup.xml (rather than a moodle.xml file) which was the road map to restoring the course.

This was the ONLY method to restore 1.9's to 2.x without legacy.   Yes,  a pain in the ....!

For one school that had over 200 courses, teachers were given the option of starting over or having their 1.9 course 'migrated' through a 2.3.x and then backed up, then restored to the higher version.  It took about 3 weeks time.

'spirit of sharing', Ken

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

Re: Upgrade from 1.9.3 to latest

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Yep.. thought it might be, but if it gets away from the legacy trap....

Ahh the value of regular upgrades....thoughtful