Getting rid of Installatron (upgrade to 3.6.3)

Getting rid of Installatron (upgrade to 3.6.3)

by W. Schouten -
Number of replies: 12

Dear Moodle-admin,

Some time ago, I've installed Moodle by using the Installatron-function (cpanel) of my provider. I was curious about Moodle and was happy about the 'automatic' updates. However, an upgrade to 3.6.2 caused problems which are fixed a couple months ago. So far so good.

The upgrade to 3.6.3 caused some challenges as I want to get rid of the Installatron-function. The steps, I've taken are as follow:

  • Created a backup of the public_html-folder (complete with data-folder)
  • Removed Moodle from Installatron
  • Manually created a database in cpanel with values from config.php
  • Followed the Installing Moodle-document (web-based installer) so the webserver includes version 3.6.3 with my data-folder of 3.6.2. (https://docs.moodle.org/36/en/Installing_Moodle)
  • I'm unable to trigger the installation as no connection to the database can't be made (enabled: '$CFG->debug = (E_ALL | E_STRICT);' and '$CFG->debugdisplay = 1;' in config.php

The problem is the password which I can't remember unfortunately. The salted one in config.php doesn't match the one in cpanel. I've changed config.php by adding '$CFG->includeuserpasswordsinbackups = true;' and changing '$CFG->dbpass    = '' with the plain database password of cpanel. However, without any success sad.

Which following step do you suggest. Help!


Average of ratings: -
In reply to W. Schouten

Re: Getting rid of Installatron (upgrade to 3.6.3)

by Ken Task -
Picture of Particularly helpful Moodlers

Too confusing to follow so really don't have any suggestion as to where you could go from where you are.

However, having said that ... did you begin by making a full site backup of the site you had working?

Hope so ... cause it might be the only way to get it back up and running again is to restore what you had and try it again.

Why?  Installatron-function ... which suggest remotely hosted and hopefully NOT on a shared host.  Unless one here in community happened to host where you do and used hosting providers scripts to install/maintain a moodle, folks like myself, who could possibly help, can't ... would be guessing forever and ever. sad

So ... where do you host?  What type of server do you have?  Shared/Managed/Self-Managed.  Do you have ssh access to the server? (terminal icon in cPanel).

'SoS', Ken


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

Re: Getting rid of Installatron (upgrade to 3.6.3)

by W. Schouten -

Thanks for your reply Mr. Task!

I've been in touch with the hosting party as well as its suppliers as the database caused really problems. That's the reason for the late reply. The database has been restored so the initial error has 'disappeared'. So far so good ;).

So DirectAdmin doesn't show the Moodle installation anymore which makes me happy. I've restored the moodledata and config.php from version 3.6.2 and transferred the moodle-latest-36 (3.6.3) to the webserver. I'm very surprised no upgrade process starts when going to my Moodle-site. Can someone explain?

Currently, I do see the list of courses and after clicking a course I can enter my admin username and password. However, there's again a database-error (please see attachment). Thanks to $CFG->debug = (E_ALL | E_STRICT) and $CFG->debugdisplay = 1;
Is this really the problem which has to be fixed (I wish to trigger the upgrade process):
Debug info: Duplicate entry '1-wim@famschouten.eu' for key 'mood_user_mneuse_uix'
Stack trace: line 489 of /lib/dml/moodle_database.php: dml_write_exception thrown

Kind regards, Wim

PS. I don't have ssh access to the server, unfortunately.

Attachment Moodle-Database error-20190509.png
In reply to W. Schouten

Re: Getting rid of Installatron (upgrade to 3.6.3)

by Ken Task -
Picture of Particularly helpful Moodlers

Any error writing to the DB isn't good.

Site mods/blocks/themes appears to be 3.6.3 but am wondering if the upgrade actually completed all that it should have.

The  "Duplicate entry '1-wim@famschouten.eu' for key 'mood_user_mneuse_uix'" is the culprit and the only suggestion I have for ya, unforunately, you cannot do because it involves executing php scripts in moodlecode/admin/cli/

Just to be sure, however, can you check config.php for the DB variables section and specifically for 'dbcollation'.

Can you go to Site Admin -> Environment?

or directly to that area via https://yourserver/admin/environment.php

What does is say at the bottom about Full Unicode Support.

For your helpdesk support:

https://docs.moodle.org/36/en/MySQL_full_unicode_support

Might mention to them that there are scripts in moodlecode/admin/cli/ that will get Full Unicode Support but if one cannot set my.cnf (you are on shared service), then only global commands for settings can be used via phpmyadmin .... as it says/shows in the link above.

Now I don't think sharing where you host ... the company that provides ... is giving away any security issues about which you would need be concerned.   So what company do you host with?   Is your account a shared hosting package where multiple customers share the same server resources and databases?

'SoS', Ken


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

Re: Getting rid of Installatron (upgrade to 3.6.3)

by W. Schouten -

Good morning Ken,

Thanks for your extensive answer. I've checked the config.php-file about the DB variable 'dbcollation' and the current value is: 'utf8mb4_unicode_ci'.

I hope this variable and its value can point us in the right direction as no option exists to go to Site Admin -> Environment. The main reason is you've login which is the problem ;).

Kind regards,

Wim

In reply to W. Schouten

Re: Getting rid of Installatron (upgrade to 3.6.3)

by Ken Task -
Picture of Particularly helpful Moodlers

On the line for 'dbcollation' => are there two slashes (//) in front of that line?

We have to make sure it's active ... being used by moodle.  A // in front means it's inactive.

The fix to the database is to have the database, its tables, and all columns in those tables have the same character set (utf8mb4) with collation (utf8mb4_unicode_ci).   In a stock (plain jane) moodle, there are approximately 407 tables.   If your DirectAdmin has a tool that can convert the DB to utf8mb4 *and* collation of all tables and columns to utf8mb4_unicode_ci then you could do it yourself (after backing up your db).

IF DirectAdmin doesn't have something like that ... don't think you'd want to do 1 table at a time ... take forever ... then the only other alternative  is to execute the command line only script in moodlecode/admin/cli/ 

/usr/bin/php admin/cli/mysql_collation.php --collation=utf8mb4_unicode_ci

Since you don't have ssh, your help desk will have to do that for you.

Now I asked for where you host ... what company.  Only reason, was going to Google to see if provider had some FAQ's or customer how 2's on DirectAdmin and how to work with the DB for you.  But, since you've not shared that, you can do that.

Have taken this one as far as I can without asking for access to your server.

'SoS', Ken


In reply to Ken Task

Re: Getting rid of Installatron (upgrade to 3.6.3)

by W. Schouten -

Yes, I do realize Ken!

I can share the good news.... as the Moodle-installation is working 'properly'. The only change which is made to change the dbcollation-parameter in config.php. The current setting is 'dbcollation' => 'utf8_unicode_ci' and I can logon. Thanks to Ken!

I'm very curious why the previous setting did work for some days after the first upgrade to 3.6.3 at 22-4. Now, I'll work on the conversion of the database to utf8mb4_unicode_ci after making a backup of the current database. Thank you so much Ken.

Have a nice weekend!

Wim

In reply to W. Schouten

Re: Getting rid of Installatron (upgrade to 3.6.3)

by Ken Task -
Picture of Particularly helpful Moodlers

Good!  Congrats!  

So was that line commented out?   What change did you make?

Do feel free to mark which ever response helped as 'Useful'.   It's another way of saying 'thanks'. smile

'SoS', Ken


In reply to Ken Task

Re: Getting rid of Installatron (upgrade to 3.6.3)

by W. Schouten -

Thank you!

No, the line wasn't commented out. I've changed the value from 'utf8mb4_unicode_ci' to 'utf8_unicode_ci'.

Nice weekend,

Wim

Average of ratings: Useful (1)
In reply to W. Schouten

Re: Getting rid of Installatron (upgrade to 3.6.3)

by Ken Task -
Picture of Particularly helpful Moodlers

Very good!  Thanks for responding.   So no need for full unicode mysql support.

Would be a handy tip for other users using same provider facing the same issue ... if provider were known.   But, could be added to the list of things to try ... which just frustrates users with the issue even more. smile

'SoS', Ken


In reply to W. Schouten

Svar: Getting rid of Installatron (upgrade to 3.6.3)

by Karin Ahlén -

I have also been using Moodle with Installatron and like you the site stopped working after the update to 3.6.3. I now get the error "ERR_TOO_MANY_REDIRECTS" and purging all type of caches does not work. Luckily a backup was made before the upgrade so now I'm trying to restore Moodle to it's previously state. 

In reply to Karin Ahlén

Svar: Getting rid of Installatron (upgrade to 3.6.3)

by Karin Ahlén -

This is just getting more confusing... I was failing to restore the backup from Installatron (first the space was to small, then the host gave us some more space temporary, and then other errors showed up), but then a mail from Moodle came that informed me about a new submission. How could this be I thought, the site is down and in a middle of a restoring of a backup. But I checked the submission, and Moodle was up and running like nothing had happened(!). It was also running the new version 3.6.3. I am totally baffled.  

In reply to Karin Ahlén

Re: Svar: Getting rid of Installatron (upgrade to 3.6.3)

by W. Schouten -

You're the lucky one! It probably has to do with cache. I wish to have the ability to restart the webserver but in my situation that wouldn't be possible.

In the meantime, I've set the PHP version in the Direct Admin to 7.2 (is supported by Moodle 3.6.x as I've read) although, 2 missing settings (Opcache and XMLRFC) had to be selected manually.