Upgrading 2.5.4 to 3.4

Upgrading 2.5.4 to 3.4

by Karikalan Kumaresan -
Number of replies: 17

Hi, I have an old Moodle version 2.5.4. I am now trying to upgrade it to 3.4. However, it seems that it is not possible to do it directly, so trying to upgrade it first to 3.0 and then to 3.4. I have done the following,

1. Backed up the old moodle 2.5.4 (software, database and filestore).

2. Downloaded the Moodle 3.0 version and unpacked the package.

3. Copied the config.php from the old moodle to the new moodle directory (which points to the existing old database and filestore).

4. Restarted the apache and accessed the Moodle from the browser. 

I get the login page but with an error saying that "Error reading from database". I could not see any error logs in apache. I tried switching on the debug mode in the database, but it did not reflect it in the page. I expected Moodle to upgrade the DB from old version to new version when the new source code is accessed from the browser (with some upgrade steps), however that is not happening. 

I am stuck with this, any help would be greatly appreciated.

Thanks.

Average of ratings: -
In reply to Karikalan Kumaresan

Re: Upgrading 2.5.4 to 3.4

by Ken Task -
Picture of Particularly helpful Moodlers

Hope you began the process by making a site backup .... DB dump and an archive of the 2.5.x code directory you have.

It is normally recommended one test upgrades on a sandbox server ... not production ... to work out any hickups/glitches/un-planned grimlins, etc.

Server Linux (distro) or Windows or Mac or ????

With the site 2.5.4, go to Server - Environment and update the component.    Then in the drop down pick list of the versions of Moodle,  it will show your current version selected first.   Use the drop down and select version 2.7.  See any checks/warnings?   Do the same for 3.0.x.  Hopefully you will see what might be things you will have to do at stages of the upgrade path.

See what checks show up red ... version of PHP?  version of MySQL? Database engine ... character set and collation now come into play with the 'upgrade distance' ...   2.5.4 -> 3.4.latest will require you to do the upgrades in stages.

Also ... got any addons installed in the 2.5.4?   Might want to research if those addons actually have a compatible version for the destination version.

'spirit of sharing', Ken


In reply to Ken Task

Re: Upgrading 2.5.4 to 3.4

by Karikalan Kumaresan -

- Backup: Yes, I have backed up the entire moodle folder, db and the moodle data folder. 

- Rehearsing: Yes, I am testing the upgrade first in the test server not directly in the production. 

- Versions: I am running Moodle in CentOS 6.5, PHP 5.4.45 and MySQL 5.5.59.

- Check: I have checked in the Server->Environment with update component, for 3.0. Except couple of checks all others displayed OK. No red was displayed. 

- Upgrading: Instead of upgrading from 2.5.4 ro 3.4, I am first upgrading from 2.5.4 to 3.0. Then planning to upgrade from 3.0 to 3.4. 

- Add ons: I have not checked the compatibility, but thinking of updating those one by one after the moodle upgrade. 

However, I am stuck with the error I have mentioned ("Error reading database") after copying Moodle 3.0 source and trying to access. After copying the new source and pointing to the old database, it should upgrade the database when accessed first right?

Any help would be greatly appreciated to resolve this issue.

Thanks.

In reply to Karikalan Kumaresan

Re: Upgrading 2.5.4 to 3.4

by Ken Task -
Picture of Particularly helpful Moodlers

The error reading from DB might actually be due to going to far on the first hop in the march.

Check other server logs ... apache error log for one.

In the environment check you did prior to pulling trigger on 2.5.4 to 3.0.highest, where you now have the error, did you look at 2.7.highest?    Some where along the path one has to upgrade the PHP to at least 5.6.x and from what I re-call the DB version as well.  + MySQL you must upgrade the engine to InnoDB since it has become a requirement in Moodle 3.0.  

Consider installing mysqltuner - predict there will be recommendations it finds for InnoDB twaking ... upwards of course.

https://github.com/major/MySQLTuner-perl

Lots to look over, but https://docs.moodle.org/dev/Releases

Thought it would show to you when checking 2.7 - from what I re-call (it's been many moons since 2.5.4!).   Am trying to re-call ... think you can do 2.5.4 to 2.7.highest, check environment, check plugins, backup code and DB ...  then to 3.0.highest ... ditto on checks ... then to 3.4.highest.

About your server, think I'd increase PHP time for scripts to execute to something higher than 30 seconds, memory scripts can consume ... 256M  ... DB ... max_input_vars => 3000 and max_allowed_packet to 32M.

Wouldn't skip checking plugins till the end ... some might actually kill an upgrade ... check at each hop in the march and upgrade them at that stage.

Installing moosh and using it to check plugins will help with plugin versions.

https://moosh-online.com/

https://moosh-online.com/commands/

moosh plugin-list 

'spirit of sharing', Ken


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

Re: Upgrading 2.5.4 to 3.4

by Karikalan Kumaresan -

Hi,

I have upgraded from 2.5 to 3.0. However, I could not upgrade subpage activity from 2.5 to 3.0, even when I copy the subpage under mod directory, it does not appear in the courses. Collapsed topic format seems to have upgraded fine, but not the subpage. Also my custom block seems to have lost the localisation text. 

Any idea why this could be?

Thanks,

Kari...

In reply to Karikalan Kumaresan

Re: Upgrading 2.5.4 to 3.4

by Karikalan Kumaresan -

Hi, after some struggle managed to upgrade to 3.4. However, I have the following issues,

1. The collapsed topic (downloaded from Plugins directory for moodle version 3.4) displays unwanted sections (ie, "Section 10", "Section 11" ... "Section 117"). In the old version I just had the sections named and there was an option in the settings to limit the number of sections, but in the new version it seems to be missing and displays a long list of sections in collapsed topics.

2. The subpages and SCORM packages of other sections are all displayed under the first section in the migrated version of the moodle. I am not sure why.


Any help would be greatly appreciated.

Thanks.

In reply to Karikalan Kumaresan

Re: Upgrading 2.5.4 to 3.4

by Karikalan Kumaresan -

Adding to the above, in some of the courses I get the following error 


Notice: Trying to get property of non-object in /srv/gitanos/course/format/topcoll/renderer.php on line 822

Notice: Trying to get property of non-object in /srv/gitanos/course/format/topcoll/renderer.php on line 823and the sections does not get displayed.
In reply to Ken Task

Re: Upgrading 2.5.4 to 3.4

by Karikalan Kumaresan -

I have migrated Moodle from 2.5.4 to 3.4 (ofcourse in stages). I have downloaded the Collapsed Topic format (ver: 2017110300) from the moodle plugin directory for 3.4. I use subpage activity under every section. While it has migrated all the content fine, it has the following issues,

  1. All the sections have been migrated fine (along with the subpages, which has scorm packages / files in it), however there are additional sections created (Section 110, Section 114 etc) which contains the items under the subpages (from initial sections).

  2. Hiding those sections hides the section, but also the packages/files under the section and it is not visible from the subpage in initial sections as well.

  3. Removing those sections removes the section, but also the packages/files under the section.

  4. Also, migrated course does not have the limit to specify for topics in the course settings, while the new course has that option.

I cannot re-add those packages/files since those have some statistics associated with it. So, it is a kind of blocker and I am not able to proceed further. It seems to be a bug, any help would be greatly appreciated.


In reply to Karikalan Kumaresan

Re: Upgrading 2.5.4 to 3.4

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

What is a subpage??  Is it some customized plugin that you have?

But in order to link to activities but not show them on the course page, there is now a new option for activities - you select "hide", and then you select "make available" from the edit menu.  This replaces what used to be orphaned activities.

Average of ratings: Useful (1)
In reply to Emma Richardson

Re: Upgrading 2.5.4 to 3.4

by Karikalan Kumaresan -

Subpage is an activity (module) to achieve the sub-section option (when sub-section was not available) in Moodle 2.5.4 (https://github.com/moodleou/moodle-mod_subpage). I have upgraded that along with other plugins. 


So, the actual issue now is that whatever package/files which were under the subpage, are shown in the newly created sections (automatically created when migrating moodle).

Example:

Before upgrading Moodle (2.5.4):
Section 1

   - subpage 1

       - file1

   - subpage 2

       - file 2

After upgrading Moodle (3.4.1):

Section 1

   - subpage 1

       - file1

   - subpage 2

       - file 2

Section 110 (automatically created)

       - file1

       - file 2


So hiding or removing "Section 110" hides/removes file1 and file2 under Section 1/subpage1 as well.
In reply to Karikalan Kumaresan

Re: Upgrading 2.5.4 to 3.4

by Ken Task -
Picture of Particularly helpful Moodlers
+1 to Emma's suggestion.

However, a couple of questions ...
1. was collapsed topics installed in the 2.5.4 when you began the 'march'?
2. along your 'march of moodle', did you stop at versions/stages and update plugins before taking the next hop?

'spirit of sharing', Ken
 
In reply to Ken Task

Re: Upgrading 2.5.4 to 3.4

by Karikalan Kumaresan -

1. Yes, collapsed topics was installed in 2.5.4 and was part of the migration march.

2. Yes, I did the update plugins before taking the next hop.


If you can see in the attached image, the "Módulo 4: La Gestión de la Actividad" is a migrated section with the subpage activity named Clase and Biblioteca, which contains the documents and folders, which is fine, however the "Section 110" is an automatically created section and contains the documents and folders of the section "Módulo 4: La Gestión de la Actividad", hiding or removing them hides and removes from the subpage as well.

Thanks.

Attachment Untitled.png
In reply to Karikalan Kumaresan

Re: Upgrading 2.5.4 to 3.4

by Ken Task -
Picture of Particularly helpful Moodlers

Have you turned on debugging to see if there is anything moodle might be reporting that you've not seen?

One of the reasons for using the plugin was avoiding the 'scroll of death' ... too many sections NOT using Collapsed topics.   Section 110 means a lot of sections.   Did you ever use hidden sections?

What if you were to make a backup of the course ... without users ... then restore that course to a new course.   Then tinker with changing the format of the restored course to just 'topics' (yes, you'll be fighting 'scroll of death' again, but one might discover the issue.

'spirit of sharing', Ken

In reply to Ken Task

Re: Upgrading 2.5.4 to 3.4

by Karikalan Kumaresan -

Yes, I have enabled debugging but no errors. Actually there were so many sections and many were empty, all the empty sections have been removed. However, "section 110" and the following sections upto "117" has the items as explained in the above posting. I could not hide the section or remove the section from the UI since it also hides/removes the items inside it, I just want the way to hide/remove the section without the contents of it being removed.

Exporting and importing the course might work, but I might lose all the statistics associated with it since the course will be created fresh with new ids. Otherwise, I could have chosen the option of exporting the course from moodle 2.5 and importing it in moodle 3.4 instead of going through the pain of upgradation process.

Thanks.

In reply to Karikalan Kumaresan

Re: Upgrading 2.5.4 to 3.4

by Ken Task -
Picture of Particularly helpful Moodlers

The data to which you refer is student data ... right?   Backup the course as a full backup ... with students then.   We are assuming you can back up that course ...  restore that backup to a hidden course and play with the restored/tinker course.

Are all the sections ... the 110 up to 117 ... the same ... ie, does each one of those have a 'Folder' resource contained there in?

It would be painful to do, but couldn't you add yet another section in the play course, and either move or *re-construct the folder resource* in the new section?  You can see/acquire the files in the folder resource from the sections having issues.   Then see if the new section behaves as expected.

About run out of ideas ... maybe contacting the author/maintainer of the plugin is in order.  That info found: https://moodle.org/plugins/pluginversions.php?plugin=format_topcoll

'spirit of sharing', Ken



In reply to Ken Task

Re: Upgrading 2.5.4 to 3.4

by Karikalan Kumaresan -

Hi,

After few tries, I have found the following,

1. When creating a subpage, it by default creates a section where I can add more activities (SCORM etc) under that section. However in 2.5.4 those sections were displayed as orphaned sections (hidden from students), but now those sections are displayed as a visible section at a course level itself (which is supposed to be displayed only under the subpage).

2. Without subpage, I could not organise activities under one roof. Tried flexible sections, but it is not expanding or collapsing without refreshing the whole page, also the student view is not displaying the collapse/expand arrows.

Kind of stuck with what to do, except with the option of tweaking the core moodle code to hide the sections in the course view. Any ideas?

Thanks.

In reply to Karikalan Kumaresan

Re: Upgrading 2.5.4 to 3.4

by Belinda Caulfield -

Hi Karikalan, we are having a similar problem at the moment as we have upgraded our test moodle and now all our subpage content (orphaned resources) are now displayed as hidden on the screen as I cannot change the number of topics to view as OneTopic have removed this feature (to keep it aligned with the core course themes that no longer allow you to choose the number of topics to display).  Apart from the fact they are hidden we have some courses that have over 40 subpages which will mean there will be an additional 40 topics on the page which I do not normally display.  I am playing with the test site at the moment and will update  this post if I find a solution or work around.


Kind Regards,

Belinda

In reply to Karikalan Kumaresan

Re: Upgrading 2.5.4 to 3.4

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

I haven't used subpage but I am guessing that it maybe made use of orphaned activities.  As I suggested before, you can now use stealth activities (activate this at admin level) - this will give you the option of hiding the activity from the course page but having it available to students.

Average of ratings: Useful (1)