Problem updating from 2.6 to 2.7

Problem updating from 2.6 to 2.7

by Sarah Smith -
Number of replies: 10

I have been attempting to update my site from 2.6 to 2.7. I had done this last month, but we ran into another issue (realized my template was 2.7 compatible yet), so I reverted back to 2.6.

Well, now my template has been updated, so I wanted to try the 2.7 update again. I did my plugins check and then went on to upgrade the database. However, I get an error:

mod_quiz

Table "quiz_question_instances" already exists

More information about this error

Debug info: can not rename table
Error code: ddltablealreadyexists
Stack trace:
  • line 500 of /lib/ddl/database_manager.php: ddl_exception thrown
  • line 524 of /mod/quiz/db/upgrade.php: call to database_manager->rename_table()
  • line 697 of /lib/upgradelib.php: call to xmldb_quiz_upgrade()
  • line 420 of /lib/upgradelib.php: call to upgrade_plugins_modules()
  • line 1615 of /lib/upgradelib.php: call to upgrade_plugins()
  • line 434 of /admin/index.php: call to upgrade_noncore()

I read suggestions elsewhere about dropping your database tables and doing a fresh install. So, that's what I did. I dropped all of my database tables and did a new install of 2.7. After that, I restored my database to the backup that I had taken. Unfortunately, all that did was take me back to where I started - I had to go through the PHP check and then the plugins check again and then it wanted to update the database. 

Is there anything else that I can do to finally get updated to 2.7?

Average of ratings: -
In reply to Sarah Smith

Re: Problem updating from 2.6 to 2.7

by Ludo M -

Hello,

I've got the same kind of problem :


Debug info: can not rename table
Error code: ddltablealreadyexists


  • line 500 of /lib/ddl/database_manager.php: ddl_exception thrown
  • line 76 of /question/type/multichoice/db/upgrade.php: call to database_manager->rename_table()
  • line 535 of /lib/upgradelib.php: call to xmldb_qtype_multichoice_upgrade()
  • line 1615 of /lib/upgradelib.php: call to upgrade_plugins()
  • line 434 of /admin/index.php: call to upgrade_noncore()


Any news about this problem ?

In reply to Ludo M

Re: Problem updating from 2.6 to 2.7

by Sarah Smith -

I was finally able to get it updated, see my other forum post here: https://moodle.org/mod/forum/discuss.php?d=267347

Basically, because I had attempted the update before, I already a table (mdl_quiz_slots) in my database that it was trying to create (although, the error message stated the wrong table name). There were a couple more tables that had the same message and once I deleted those, I was able to complete the update. 

Hope this helps you!

In reply to Sarah Smith

Re: Problem updating from 2.6 to 2.7

by Sarah Smith -

I tried updating to the newest version of 2.6 (build 20140814) and that was successful. Then I attempted to upgrade to 2.7 from there, but I ran into the same error message. Is there anyone with any idea how to get around this?

In reply to Sarah Smith

Re: Problem updating from 2.6 to 2.7

by Sophia Barton-Bucknor -

Hi Sarah,

I think I have the same problem and from reading this forum it seems many others do. However, I this is my first time doing an upgrade. I have a hostgator account. Can you help me with the steps to upgrade? I have 2.6.1 installed and would like 2.7.1. However, If I can successfully upgrade to the latest version of 2.6 that would be a start.

Sophia

In reply to Sophia Barton-Bucknor

Re: Problem updating from 2.6 to 2.7

by Sarah Smith -

If you've never done an upgrade, this page should be helpful: https://docs.moodle.org/27/en/Upgrading 

These are my general steps:

  1. Put site in maintenance mode
  2. Take a backup of public_html and moodledata folders
  3. Take a backup of the database
  4. Remove all files from public_html, upload the .zip file of the new Moodle version, and extract the zip file
  5. Upload the config.php file to public_html from your backup
  6. Go to your Moodle site and go through the steps to upgrade your plugins and then the steps to upgrade your database
  7. You'll see a list of all of the new settings that come with the upgrade - you can change them then or leave them as the defaults and change them later if needed
  8. Take site out of maintenance mode

Sounds easy, until you run into errors!

In reply to Sarah Smith

Re: Problem updating from 2.6 to 2.7

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Often times, the errors are produced by server settings, like in this case (as an example, don't know for sure) not having the correct version of PHP for 2.7.

In your suggested step 4, I would say "Remove all Moodle files, including the moodle folder, if moodle is in its own directory."  I have moodle installed in ../public_html/moodle, but I have many (many) files in my public_html folder.  Removing these would destroy my website.

I also prefer to say (step 3.5), "Copy your current config.php file to a safe location.  You will need this after unzipping Moodle."

Then, step 5 becomes "Copy your saved config.php file into the (root) /moodle folder, or to public_html if your moodle is your main website."

Of course, some people don't name their folder /moodle, and some folks want moodle files in their root public_html folder (to have moodle show right in their main domain website, which is another reason why something that might seem simple is not.

In the past, Plesk used to create a folder called httpdocs (or something like that), instead of public_html.

Well, this is why writing documentation is difficult, especially with a product as flexible as moodle.

Average of ratings: Useful (1)
In reply to Sarah Smith

Re: Problem updating from 2.6 to 2.7

by Sophia Barton-Bucknor -

Thanks Sarah and Rick. I followed your steps but unfortunately I was not successful - I got a number of errors. I had to restore my backed up version (www.nutrigenomicsonlineeducation.com).

Feeling so confused.

Sophia



In reply to Sophia Barton-Bucknor

Re: Problem updating from 2.6 to 2.7

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Okay, let's get back to it.  It has been about a month.

What is your first error?  Can you provide a screen shot?


In reply to Rick Jerz

Re: Problem updating from 2.6 to 2.7

by Sophia Barton-Bucknor -

Unfortunately I will not be able to attempt another update until Friday. I will post messages, if still unsuccessful, at that time. 

Thanks for your willingness to help.