upgrade from 1.5 to 1.8 - HotPot upgrade failed

upgrade from 1.5 to 1.8 - HotPot upgrade failed

by Inna Abcid -
Number of replies: 13

Hi

I am upgrading from 1.5 to 1.8 and getting the following error:

Upgrade function xmldb_hotpot_upgrade was not available in hotpot: /home/beaut17/public_html/mod/hotpot/db/upgrade.php.

Upgrading hotpot from 2005031418 to 2007020200 FAILED

Please help.

Inna

Average of ratings: -
In reply to Inna Abcid

Re: upgrade from 1.5 to 1.8 - HotPot upgrade failed

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
I think 1.5 -> 1.8 is too big a leap. I suggest you do it in stages:
  • 1.5 -> 1.6
  • 1.6 migrate to utf-8 (unicode)
  • 1.6 -> 1.7
  • 1.7 -> 1.8
Hope that works for you!
Gordon
In reply to Gordon Bateson

Re: upgrade from 1.5 to 1.8 - HotPot upgrade failed

by Inna Abcid -
I cannot go back.  Are there any way to check what is the problem?
In reply to Inna Abcid

Svar: Re: upgrade from 1.5 to 1.8 - HotPot upgrade failed

by Alf Martin Johnsen -
I hope you have taken the highly recommended step: a backup of your database AND moodledata-files? If no, it seems to me that your only way back to a functioning site are via your course-backups. An Upgrade from 1.5 implies converting your database to utf-8, and you need to upgrade to 1.6 or 1.7 before the 1.8 version. (The UTF-8 convert-program is only included in 1.6 and 1.7, assuming that you already have an utf-8 database when upgrading to 1.8.)

So, if you only have course backups; Perform a complete new install from scratch, and then restore your courses, one by one - puh...

Alf Martin
In reply to Alf Martin Johnsen

Re: Svar: Re: upgrade from 1.5 to 1.8 - HotPot upgrade failed

by Wesley Lee -

OH my, I had this same error message, and what I thought was a backup did not happen. 

Is there anyway to fix this problem besides requiring to take small steps at a time?

In reply to Wesley Lee

Re: Svar: Re: upgrade from 1.5 to 1.8 - HotPot upgrade failed

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Do you have this file on your Moodle site?
  • mod/hotpot/db/upgrade.php
And if you do have the above file, please open it with a text editor and tell us if it contains the following function:
  • function xmldb_hotpot_upgrade($oldversion=0) {
thanks
Gordon



Notes to self:
  • this error message seems to come from "lib/adminlib.php" (around line 138)
  • from the following block:
    if ($newupgrade && function_exists($newupgrade_function) && $oldupgrade_status) {
    $db->debug = true;
    $newupgrade_status = $newupgrade_function($CFG->$pluginversion);
    } else if ($newupgrade) {
    notify ('Upgrade function ' . $newupgrade_function . ' was not available in ' .
    $fullplug . '/db/upgrade.php');
    }
  • so if the "$oldupgrade_status" was returned empty from "hotpot_upgrade" in "mod/hotpot/db/mysql.php", then "Upgrade function ... does not exist" message would appear even though, the function does exist.
  • it could be that one of the functions in "mod/hotpot/db/update_to_v2.php" is failing

In reply to Gordon Bateson

Re: Svar: Re: upgrade from 1.5 to 1.8 - HotPot upgrade failed

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
I tried upgrading 1.5.4 (with a unicode database) straight to 1.8.1+ on a site with several HotPots and the upgrade worked OK. Hmm ... thoughtful

I will wait to hear from you for more details about the state of your scripts and database.

If you try the upgrade again, please switch on debugging on your site - you can do this manually by setting the "debug" record in the "mdl_config" table to "15".

cheers
Gordon
In reply to Gordon Bateson

Re: Svar: Re: upgrade from 1.5 to 1.8 - HotPot upgrade failed

by Hans Vandenbogaerde -
Hi Gordon,

As I have I think exactly the same problem, I thought it was appropriate to jump in right here.

I installed Moodle 1.5.2 previously aided bij "Fantastico De Luxe", a tool provided by my ISP. This morning I was urged by the tool to upgrade.

The tool announced it would start the upgrade to version 1.8. It took a backup (which I have not restored yet) first. Right in the beginning, I had 3 warnings:
1/ Unicode is required to be installed/enabled
2/ php_extension iconv is recommended to be installed/enabled
3/ php_extension openssl is recommended to be installed/enabled

As to the last 2, I cannot do anything, as I do not manage my ISV's set-up. The first, even a requirement, I thought to solve afterwards, because I read "if you are upgrading, you should perform the UTF-8 migration process (see the admin page).

Therefore I continued. Finally, I got stuck with "Upgrade function xmldb_hotpot_upgrade was not available in hotpot ... Upgrading hotpot from 2005031418 to 2007020200 FAILED!"

As to your question I do have mod/hotpot/db/upgrade.php :

// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// The commands in here will all be database-neutral,
// using the functions defined in lib/ddllib.php

function xmldb_hotpot_upgrade($oldversion=0) {

global $CFG, $THEME, $db;

$result = true;

/// And upgrade begins here. For each one, you'll need one
/// block of code similar to the next one. Please, delete
/// this comment lines once this file start handling proper
/// upgrade code.

/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
/// $result = result of "/lib/ddllib.php" function calls
/// }

return $result;
}

?>

Following some other advice in this forum I did remove all the "hotpot" tables, and remove the "hotpot"-related records in the "config" table and then the HotPot module would reinstall from scratch, but it lead to the same problem when I tried to continue the migration.

The admistrator user is stuck, but other users seem to be able to use the site, so I am not inclined to put my backup back yet.

How should I proceed?

Thanks and best regards,
Hans



In reply to Hans Vandenbogaerde

Re: Svar: Re: upgrade from 1.5 to 1.8 - HotPot upgrade failed

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Hi Hans,
thanks for the information and for checking that the "xmldb_hotpot_upgrade" is actually present.

I think my earlier hunch is looking more likely, namely that the error message is in fact telling us that something in "mod/hotpot/db/update_to_v2.php" is failing.

I would like to investigate exactly what is happening on your site. Would it be possible for you to send the access details for your server by email to me at:
gordon at-sign kanazawa hyphen gu dot ac dot jp

If you don't want to let me touch your live site, please upload the database backup to your server and send the URL, and I will update your database on my own server.

thanks
Gordon
In reply to Gordon Bateson

Re: Svar: Re: upgrade from 1.5 to 1.8 - HotPot upgrade failed

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
I think I have tracked down the cause of this error message wide eyes

During the upgrade from Moodle 1.5 to 1.6, the HotPot module tries to create the "hotpot_details" table. To do this, it is uses the function "hotpot_create_table" in "mod/hotpot/db/update_to_v2.php". This function assumes the presence of "mod/hotpot/db/mysql.sql", but this file was removed in Moodle 1.8!

To fix this error you can do either of the following:
  • create the "hotpot_details" table by hand, using the following SQL:
    CREATE TABLE mdl_hotpot_details (
    id int(10) unsigned NOT NULL auto_increment,
    attempt int(10) unsigned NOT NULL default '0',
    details text default '',
    PRIMARY KEY (id),
    KEY hotpot_details_attempt_idx (attempt)
    ) TYPE=MyISAM COMMENT='raw details (as XML) of Hot Potatoes quiz attempts';
    Notes:
    • Create the table before the upgrade
    • The above SQL assumes the prefix for your Moodle tables is "mdl_".
      If you use some other prefix, then please replace "mdl_" with the prefix that you use.

  • put the "mysql.sql" file in the "mod/hotpot/db" folder.
    You can get the "mysql.sql" file in the following ways:
Please let us know which method you try and what the results were smile

all the best
Gordon
In reply to Gordon Bateson

Re: Svar: Re: upgrade from 1.5 to 1.8 - HotPot upgrade failed

by Hans Vandenbogaerde -
Thanks Gordon, the problem seems to be solved.

As the upgrade was in progress, I used the second possibility and continued where I got stucked. The process picked up and all seems to work fine.

Except for UTF-8, of course, I still have to perform the UTF-8 migration process (see the admin page), but for 1.8 (where I guess I am now) you already pointed out that this option is not available anymore. How could this be solved?

Thanks again and best regards,
Hans
In reply to Hans Vandenbogaerde

Re: Svar: Re: upgrade from 1.5 to 1.8 - HotPot upgrade failed

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Dear Hans,
thanks for the good news. Hurray! Hurrah!

> UTF-8 migration process ... for 1.8 ... How could this be solved?

As far as I know, there is no easy, automatic way. If you are not using any multibyte characters, you may be OK with the following horribly dirty hack:
  1. using your favorite database adminstration software, e.g. phpMyAdmin, export the entire Moodle database to an ".sql" file
  2. open up the ".sql" file with a text editor and make the following changes:
  • change all "CHARSET=latin1" to "CHARSET=utf8"
  • change all "COLLATE=latin1_general_ci" to "COLLATE=utf8_general_ci"
save the modified sql file create a new database whose default collation (=encoding) is "utf8_general_ci" import the modified sql file into the new database modify the "config.php" in your Moodle 1.8 site, so that it uses the new database Hope that helps, but if not ... you still have the backup smile

kind regards
Gordon
In reply to Gordon Bateson

Re: Svar: Re: upgrade from 1.5 to 1.8 - HotPot upgrade failed

by Fabio Batalha M. Barros -
Gordon, thanks a lot !
I have the same problem and your "mysql.sql" save my instalation of moodle 1.6.1 to moodle 1.8.2

Thanks very much.

From Brasil,

Fabio Batalha
In reply to Fabio Batalha M. Barros

Re: Svar: Re: upgrade from 1.5 to 1.8 - HotPot upgrade failed

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Hi Fabio,
it is good news that your Moodle has been saved but I worry that if you got this message then your database was never properly migrated to Unicode while you were at Moodle 1.6.

The most common cause of this that I know of is that Moodle was installed using Fantastico, which creates a non-unicode database, but masks this fact by adding the following setting to "config.php":
$CFG->unicodedb = true;

With this setting, Moodle will assume that the database is unicode, and will not warn you or try to help you when could do so.

So please check through you courses and verify that there is no corruption of the text displayed on the various Moodle pages. If you find no errors, you can probably continue without any further trouble. However, if you find some characters do not display correctly, it might be sensible to do the incremental upgrade and unicode migration that I described in earlier posts on this thread.

best of luck!
Gordon