Upgarde from 1.5.4 to 1.6 latest

Upgarde from 1.5.4 to 1.6 latest

by Jon Witts -
Number of replies: 29
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Hi,

I just tried to upgrade my 1.5.4 (2005060240) version of Moodle to version 1.6.5

I followed the instructions on general upgrading and on upgrading version 1.6, however I ran into problems. When visiting the admin page after copying my themes folder and config.php file over to the new Moodle folder, a had a few errors on failures when upgrading the database. they mostly seemed to be about tables that existed already. However at the end of that script, I was told teat the database had been successfully upgraded, so I continued and then was presented with the admin > variables page. I then navigated to the root of the admin page to continue converting my database to UTF8. However when loading this page I kept getting stuck in a loop with an error saying that Moodle could not create the data tables. Unfortunately I did not save the first upgrade screen, only the one from the loop, which I have attached.

Any ideas as to why this is failing? I ma desperate to get our install upgraded and up to UTF8 so my staff can make use of the new features.

Oh yeah... I did back everything up fully and have dumped the database and restored everything to how it was two minutes before I started this upgrade! smile So at least we have not lost anything!
Average of ratings: -
In reply to Jon Witts

Re: Upgarde from 1.5.4 to 1.6 latest

by Jon Witts -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Anybody have any ideas about this problem? I feel like our site is going to be stuck on version 1.5 forever!
In reply to Jon Witts

回复: Upgarde from 1.5.4 to 1.6 latest

by uw i -

I meet the same problem.

Hope someone can help us.

In reply to uw i

Re: Upgrade from 1.5.4 to 1.6 latest

by Jon Witts -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Yeah me too! wink

I am going to have to try the upgrade again over the summer holidays and see if I can come up with any more information about why it might be failing. From the errors that I had returned during the upgrade, it seems to me like I might have a table in the structure of my database that should not be there???

All of the SQL errors appear to be around the data table, and the sub tables of data. i.e. data_comments and data_ratings. Are these tables used for the database module of Moodle? And if so, am I correct in thinking that this is not present Moodle 1.5 anyway? Is it possible that an earlier failed upgrade has left me with a database containing both 1.5 and 1.6 tables?

If that is the case, would I be able to just drop the tables that should not be there and try the upgrade again?

The only thoughts I have on that are that there are references to duplicate fields in the log_display tables. All of these duplicates seem to again refer to the data module. Could I just drop these fields from the table without damaging 1.5, and then see if it will upgrade with any errors?

Any help much appreciated.

Jon
In reply to Jon Witts

Re: Upgrade from 1.5.4 to 1.6 latest

by Steve Hyndman -

Jon,

The database module wasn't a standard module in 1.5, but it was in the modules & plugins download area and could be added to a 1.5 install. It sounds like you, or someone, may have added that module to your 1.5 install.

I would suggest (after backing everything up, of course) removing the database module from your 1.5 install (just go into your admin area and delete the module), then upgrade without that module. You could even back-up and download any courses that contain databases to restore once you have a successful upgrade to keep you from having to manually re-create them.

The database module is standard in 1.6, so it will (should) be there once you upgrade. Good luck.

Steve

In reply to Steve Hyndman

Re: Upgrade from 1.5.4 to 1.6 latest

by Jon Witts -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Steve,

Good thinking! I just went to check if I have the database module installed, but it is not there... Now this is getting curious!! thoughtful

I am the main Moodle Admin for our school and do not remember installing the database module at any point.. but it just be my memory! smile

I have attached the SQL dumps of the 6 data tables, so hopefully someone can tell me if this is from the 1.5 installed module or from an error in trying to upgrade to 1.6

I also logged into MySQL on the server and checked to see if there was anything in the data tables... Nothing! Here is the output from MySQL...

mysql> select * from vle_data;
Empty set (0.00 sec)

mysql> select * from vle_data_content;
Empty set (0.00 sec)

mysql> select * from vle_data_comments;
Empty set (0.00 sec)

mysql> select * from vle_data_fields;
Empty set (0.00 sec)

mysql> select * from vle_data_ratings;
Empty set (0.00 sec)

mysql> select * from vle_data_records;
Empty set (0.00 sec)

mysql>

Is it safe for me to drop these tables?

Thanks,

Jon
In reply to Jon Witts

Re: Upgrade from 1.5.4 to 1.6 latest

by Jon Witts -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I have been looking into the MySQL errors I got when trying to upgrade in a bit more detail and I am even more confused now. I can see that I do indeed have the data tables that it seems should not be there. However the errors I received after the duplicate table errors were for duplicate keys in the log_display table. I have looked through this table and can not see any of the duplicate entries that are given as errors (any of the entries with data as their prefix...)

I have copied the output of the log_display table from MySQL into the attached text file. I can not understand why the update process is giving me errors on duplicate keys in this table, when the keys do not exist, as far as I can see...

Thanks

Jon

_______________________________________________________________

EDIT:

Just looking at the errors again and unless I am mistaken it looks like the upgrade is trying to add the same row into the display_log table three times... thoughtful

Here is one example...

(mysql): INSERT INTO vle_log_display (module, action, mtable, field) VALUES ('data', 'update', 'data', 'name')
1062: Duplicate entry 'data-update' for key 2
 
 
 

 

Error




In reply to Jon Witts

Re: Upgrade from 1.5.4 to 1.6 latest

by Richard Enison -

JW,

I hate to waste  your time (and mail server disk space, etc.) with a post when I don't have the answer for your problem, but I thought you should know:

I really don't think it was trying to insert the same row three times. It was just reporting the same insert attempt at three levels. upgrade_activity_modules called modify_database, which called execute_sql, which called ADOConnection.Execute, which called ADOConnection._Execute.

I agree that it appears, on the basis of your attachment, that the duplicate entry error msg. is bogus, but I don't know when exactly you created that text file. Something must have changed some time, or else there is a serious bug in the _Execute method of ADOConnection (or in MySQL, or PHP)! surprise

RLE

In reply to Richard Enison

Re: Upgrade from 1.5.4 to 1.6 latest

by Jon Witts -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
RLE,

It's not a waste of time. Any information is good information in this case, as I feel I am stumbling round in the dark!

I created the text file just as I was posting, and I have restored the database to its original state before the upgrade after it failed. So on that basis, I suppose that the duplicate entry could have been present whilst the upgrade was trying run... Would make more sense than there being a serious bug in the ADOConnection method...

Do you think this duplicate entry error could just be a knock on from the fact that it could not set up the data tables correctly in the first place, as they already exist in my database, all be it empty?

I can not think when I could have got the data tables inserted into my database, but I have tried to upgrade a number of times and failed. I suppose it is possible I did not restore the database correctly at one time and have left the broken tables in the database.

I think I will take a backup of the database, restore it to a new database, and run another install of our Moodle alongside the live one and play around with dropping the empty data tables to see if that will let the upgrade go ahead...

I will let you all know how it goes.

JW
In reply to Jon Witts

Re: Upgrade from 1.5.4 to 1.6 latest

by Richard Enison -

JW,

Thank you for letting me know I haven't wasted your time. As I said before, I don't have the answer to your problem, but I believe I can answer one of your questions, at least. I would say no, it is not possible that an attempt to insert a record into an empty table would result in a duplicate entry error. At least, it's not supposed to. I can imagine the duplicate entry being left over from one of your previous upgrade attempts, and that you did a restore between that time and the creation of the text file, which is why the duplicate entry disappeared.

RLE

In reply to Richard Enison

Re: Upgrade from 1.5.4 to 1.6 latest

by Jon Witts -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
OK, so maybe a little closer to what is going on here...

I backed up the Moodle folder and the database and restored them to a separate database and web folder. Then i dropped the 6 data tables that I had recieved errors on about already existing. I then downloaded Moodle 1.6 latest and tried to perform the upgrade on my copy of our live Moodle.

This time I received some different errors on the first database tables update page, however the message at the end said database updated successfully. I clicked continue and was taken to the variables page. So far it looked as if it had worked. I changed the session cookie name so I did not get signed out of my live Moodle, scrolled to the bottom and pressed save.

I was then taken to another database update page and again received errors. This time when clicking continue, I was just bought back to the same error page.

I have zipped both pages and attached them to this message so people can see what is going on. To me it looks like I am having more issues with tables existing that should not be in a Moodle 1.5.4 database...

For example the first table that errors is course_request, then course_allowed_modules, then stats_daily and also tables for blogs and post. The second error page was about duplicate table for LAMS.

If I am right in thinking all of these tables are to do with 1.6 modules and updates and should not be in 1.5.4 at all.

What would be helpful would be if someone could point me in the direction of a full list of all tables that should appear in both a 1.5.4 database and a 1.6 database so that I can compare what I have in this 1.5.4 database. Then I can drop all of the unused 1.6 tables before trying to perform the upgrade again.

Thanks in advance.

Jon

In reply to Jon Witts

Re: Upgrade from 1.5.4 to 1.6 latest

by Steve Hyndman -

If I am right in thinking all of these tables are to do with 1.6 modules and updates and should not be in 1.5.4 at all.

You definitely have tables that should not be in a 1.5 install. It sounds to me like someone previously upgraded, or attempted to upgrade, your 1.5 install and what you have now is not your original 1.5 database. You may want to install a fresh 1.5 install (in a new database, or course) and then you will see the tables that should exist in 1.5 for comparison.

Steve 

In reply to Steve Hyndman

Re: Upgrade from 1.5.4 to 1.6 latest

by Jon Witts -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Good thinking Steve!

I have just done a fresh install using a copy of the current Moodle folder we are running for our VLE, into a fresh database and compared the list of tables in each database using phpMyAdmin.

There are a whole lot of tables in our current database that do not appear in the fresh install I have just done.

Here is a list of the extra tables I have:
  1. block_quickmail_log
  2. blog_tag_instance
  3. course_allowed_modules
  4. course_request
  5. data
  6. data_comments
  7. data_content
  8. data_fields
  9. data_ratings
  10. data_records
  11. fmanager_admin
  12. fmanager_categories
  13. fmanager_folders
  14. fmanager_link
  15. fmanager_shared
  16. lams
  17. post
  18. question
  19. question_answers
  20. question_attempts
  21. question_calculated
  22. question_categories
  23. question_dataset_definitions
  24. question_dataset_items
  25. question_datasets
  26. question_match
  27. question_match_sub
  28. question_multianswer
  29. question_multichoice
  30. question_numerical
  31. question_numerical_units
  32. question_randomsamatch
  33. question_rqp
  34. question_rqp_servers
  35. question_rqp_states
  36. question_rqp_types
  37. question_sessions
  38. question_shortanswer
  39. question_states
  40. question_truefalse
  41. stats_daily
  42. stats_monthly
  43. stats_user_daily
  44. stats_user_monthly
  45. stats_user_weekly
  46. stats_weekly
  47. tags
So that's it! All 47 of them!

Somewhere along the line I have completely screwed my database...

All of these tables are empty except:

fmanager_admin - 3 entries
question - 98 entires
question_answers - 381 entries
question_attempts - 48 entries
question_categories - 17 entries
question_match - 1 entry
question_match_sub - 5 entries
question_multichoice - 84 entries
question_sessions - 547 entries
question_shortanswer - 10 entries
question_states - 1946 entries
question_truefalse - 2 entries


So to me it looks like I have added the fmanager block at some point and its tables are left in my database, and it appears that I have added the question module... (which I thought was standard...?)

Is it safe for me to try and drop all empty tables and try the upgrade again???
In reply to Jon Witts

Re: Upgrade from 1.5.4 to 1.6 latest

by Steve Hyndman -

Well, it sounds to me like you know what you're doing, so as long as you have a backup so you can recover, I would say yes go ahead and drop the tables tried to upgrade and see what happens.

As a last resort, if your current 1.5 install is working, then you may need to back up each course in your 1.5 install, download the backup file, do a fresh 1.6 install, upload each course and restore.  In fact, given the problems which are running into this may be the best approach to ensure you have a good clean 1.6 install.

Steve

In reply to Steve Hyndman

Re: Upgrade from 1.5.4 to 1.6 latest

by Jon Witts -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Yeah, I had thought I might have to go the route of backing up every course and restoring one by one, but dreaded the thought of it. We have just under 200 courses and I don't fancy that route.. but you might be right about ensuring the cleanliness of my 1.6 install.

What is going to happen about all of the unicode issues though? Will an imported course from non-unicode into 1.6 unicode automatically convert the course contents to unicode?
In reply to Jon Witts

Re: Upgrade from 1.5.4 to 1.6 latest

by Steve Hyndman -

What is going to happen about all of the unicode issues though? Will an imported course from non-unicode into 1.6 unicode automatically convert the course contents to unicode?

My assumption is yes since your new database will be set to unicode, but I don't know for sure since I haven't tried it myself. Unless someone who knows can provide a better answer, you will just need to experiment...90% of what I know about Moodle (and most other apps) is just through trial and error...as you know, there is no manual and if there were, I probably wouldn't read it anyway smile

Steve

In reply to Jon Witts

Re: Upgrade from 1.5.4 to 1.6 latest

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Jon,

An alternative approach would be to uninstall all non-standard modules and blocks from your 1.5 site then attempt the upgrade again.
In reply to Helen Foster

Re: Upgrade from 1.5.4 to 1.6 latest

by Jon Witts -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Helen,

Is there anywhere were I can get a list of what the standard modules and blocks for 1.5.4 are?

Jon
In reply to Jon Witts

Re: Upgrade from 1.5.4 to 1.6 latest

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Jon,

Probably the easiest way would be to download a Moodle 1.5 package and look inside the mod and blocks folders.
In reply to Helen Foster

Re: Upgrade from 1.5.4 to 1.6 latest

by Jon Witts -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Hi Helen,

I have just downloaded Moodle 1.5.4 from Sourceforge and compared my mod and blocks folders. The only additional block that I have in my install is the enhanced messaging block. I have this running in another version of Moodle (testing site) that upgraded to 1.6 no problems at all.

If backing up a course from 1.5.4 and restoring in 1.6 would be an issue because of Unicode entries in the database; would restoring all courses to a fresh install of 1.5.4 and then trying to upgrade be a better route?
In reply to Helen Foster

Re: Upgrade from 1.5.4 to 1.6 latest

by John Isner -
Helen please correct me if I'm wrong, but Exercise and Journal are included in the latest release, and they're both non-standard modules. What's the downside of using them?
In reply to Steve Hyndman

Re: Upgrade from 1.5.4 to 1.6 latest

by Jon Witts -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

OK, so I dropped all of the tables in the above list that were empty and tried the upgrade again... Went a bit further this time then got caught in a loop trying to upgrade the quiz module.


I was presented with this error after a series of successes upgrading the quiz module "Upgrading quiz from 2005060302 to 2006060700 FAILED!" I then continued and was given errors about duplicated tables and columns in the various quiz tables. I dropped the tables and columns that it errored on and tried again.. In the end I just got back to a page with teh same error "Upgrading quiz from 2005060302 to 2006060700 FAILED!" and no option of going on.

I have attached the first page where I was given the error about the quiz module failing for info.

I am at a loss as to why this keeps failing and can not see from looking at the tables and columns that the upgrade script is trying to add, and the tables and columns I have in my database, why this would fail.
In reply to Jon Witts

Re: Upgrade from 1.5.4 to 1.6 latest

by Richard Enison -

JW,

Looks somewhat reminiscent of http://tracker.moodle.org/browse/MDL-7304 but not exactly; to a lesser extent http://tracker.moodle.org/browse/MDL-8032

RLE

In reply to Richard Enison

Re: Upgrade from 1.5.4 to 1.6 latest

by Jon Witts -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
RLE,

See what you mean. Seems rather similar to http://tracker.moodle.org/browse/MDL-7309 too, although this seems focused on PostGre...

However with all the other errors in my database, I am beginning to think that if I back up each course over the summer break, and then restore into a fresh 1.5.4 install, then try the upgrade again, I may have more success. Or at least find out what went wrong in the first place to screw up my database so much!

I have a fresh install of 1.5.4 sat there and I may bring a small number of the backups across and give it a go to see what happens...

I will keep people posted. In the mean time if anyone else has any ideas... I am more than happy to hear them!

Thanks

Jon
In reply to Jon Witts

Re: Upgrade from 1.5.4 to 1.6 latest

by Jon Witts -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
OK, So I have started trying to backup each of my courses to bring them into a fresh 1.54 install and have run into some bother. a lot of my larger courses do not finish their backup. I think it might be something to do with the amount of time that PHP scripts are allowed to run in my php.ini file... but I am not sure. Would increasing that value help the backups to complete?
In reply to Jon Witts

Svar: Upgarde from 1.5.4 to 1.6 latest

by Joar Herseth -
I got the same problem. I sat the memory limit to 50M in php.ini and upgraded from 1.5.4 to 1.6 (old version) first - that worked.

JH
In reply to Joar Herseth

Svar: Upgarde from 1.5.4 to 1.6 latest

by Joar Herseth -
...and after that the upgrade to 1.8.1 latest performed smootly.

JH
In reply to Joar Herseth

Re: Svar: Upgarde from 1.5.4 to 1.6 latest

by Jon Witts -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I will double check the memory limit setting in my php.ini file, but I would be surprised if this would fix all of the issues I have been having here... Will let you know though smile
In reply to Jon Witts

Svar: Re: Svar: Upgarde from 1.5.4 to 1.6 latest

by Joar Herseth -
Well - I suspect that it was that I first upgraded from 1.5.4 to 1.6.0, then from 1.6.0 to 1.8 that made it work. Upgrading from 1.5.4 to 1.6.5 did not work - it stopped complaning about some quiss-tables.

Joar.