database Upgrade 2.2.3 > 2.3+ error

database Upgrade 2.2.3 > 2.3+ error

by Al Brocklehurst -
Number of replies: 3

Hi All

I've been tring to upgrade my localhost from 2.2.3 to 2.3+ before I upgrade the production server and have ran into this error (screen shot below). I have tried an upgrade on the database I originally had. Then droped the tables and imported production server database. Have removed all the files (backed up first) and tried the upgrade with a freshly downloaded Moodle version this afternoon.

have searched forums and google for ideas but no luck.

error screenshot 

Debug Text reads:

Debug info: Table 'moodle2x.mdl_backup_files' doesn't exist
SELECT COUNT('x') FROM mdl_backup_files
[array (
)]
Error code: dmlreadexception
Stack trace:
  • line 407 of \lib\dml\moodle_database.php: dml_read_exception thrown
  • line 864 of \lib\dml\mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 1337 of \lib\dml\moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
  • line 1410 of \lib\dml\moodle_database.php: call to moodle_database->get_record_sql()
  • line 1581 of \lib\dml\moodle_database.php: call to moodle_database->get_field_sql()
  • line 1564 of \lib\dml\moodle_database.php: call to moodle_database->count_records_sql()
  • line 1547 of \lib\dml\moodle_database.php: call to moodle_database->count_records_select()
  • line 60 of \lib\db\upgradelib.php: call to moodle_database->count_records()
  • line 232 of \lib\db\upgrade.php: call to upgrade_mysql_fix_unsigned_columns()
  • line 1481 of \lib\upgradelib.php: call to xmldb_main_upgrade()
  • line 275 of \admin\index.php: call to upgrade_core()

Any ideas

Thanks

Average of ratings: -
In reply to Al Brocklehurst

Re: database Upgrade 2.2.3 > 2.3+ error

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Al,

the error looks really strange... because that upgrade code first detects all the available tables and later iterates over them to get their count of records.

So I cannot imagine how it's returning the backup_files as an existing table, and a few lines later, tells that the backup_files table does not exist. Seems to be an impossible situation.

All I can recommend is to verify that there isn't any missing permission and the db user specified in your config.php file has all the permissions over that table.

Also, as two possible workarounds... yo could, alternatively, pick one:

A) manually drop the backup_files and backup_ids tables (don't confuse them with similar backup_xxxx_template ones!). They are not needed by any Moodle 2.x version. And try upgrade then.

B) Wait until next Monday (2012-07-09), upgrade to latest Moodle 2.2.x available, and then upgrade to latest Moodle 2.3.x available. From that date Moodle will include the fix of MDL-34121 that, simply, does A) for you.

But I don't think your problem is really that issue. As said, it's really strange to be getting contradictory information on upgrade, sometimes the table exists and other times it does not. Plz, verify user and perms as commented above.

Hope it helps, ciao smile

In reply to Eloy Lafuente (stronk7)

Re: database Upgrade 2.2.3 > 2.3+ error

by Al Brocklehurst -

Thanks Eloy, I'll have a bit more of a play - being the localhost I'm not afraid to tweak things.

User is root and has all permissions set so what you describe is indeed strange.


All updates prior have been fine.

In reply to Eloy Lafuente (stronk7)

Re: database Upgrade 2.2.3 > 2.3+ error

by Al Brocklehurst -

Because I'm curious on the Production server I created another moodle and data directory and copied all the data files across. Also created and copied the database.

Extracted Moodle 2.3+, copied original and changed config file

Run upgrade and all went well.

Must be some localhost issue. At least I know now the production server upgrade works fine.