Moodle
  1. Moodle
  2. MDL-27265

Upgrade 1.9.x to 2.0.x Table "upgrade_log" already exists

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.0.2
    • Fix Version/s: None
    • Component/s: Unknown
    • Labels:
    • Environment:
      Mac OS X 10.6.x, Bitnami Moodle Stack
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_20_STABLE
    • Rank:
      16952

      Description

      After reading in the database dump in the new install and starting the upgrade from 1.9.x to 2.0.2 the error

      Table "upgrade_log" already exists

      is shown with the following stack trace:

      line 469 of /lib/ddl/database_manager.php: ddl_exception thrown
      line 93 of /lib/db/upgrade.php: call to database_manager->create_table()
      line 1383 of /lib/upgradelib.php: call to xmldb_main_upgrade()
      line 252 of /admin/index.php: call to upgrade_core()

      Based on what I found using Google, there seems to be no fix for the error and - since it is not possible to export courses from 1.9.x and import them into 2.0.x - either every course, etc. has to be created from scratch or the upgrade has to wait.

      1. instructionsfor2.1.txt
        1 kB
        Mignonne Davis
      2. instructionsfor2.1.txt
        1 kB
        Mignonne Davis

        Issue Links

          Activity

          Erik Keller created issue -
          Martin Dougiamas made changes -
          Field Original Value New Value
          Workflow MDL Workflow [ 69413 ] MDL Full Workflow [ 76422 ]
          Hide
          Arunas added a comment -

          Same issue when upgrading from '1.9.11+ (Build: 20110427)' $version = 2007101591.02; to 2.0.2 (Build: 20110221) version = 2011022100.00.

          The issue seems to be the lib\db\upgrade.php file where this couple code snapshots reside (same issue with message_processing, message_working) and other issues:

          if ($oldversion < 2008030600) {
          //NOTE: this table was added much later later in dev cycle, but we need it here, upgrades from pre PR1 not supported

          /// Define table upgrade_log to be created
          $table = new xmldb_table('upgrade_log');

          ........................................

          if ($oldversion < 2011020200.01) {

          // Define field targetversion to be added to upgrade_log
          $table = new xmldb_table('upgrade_log');
          $field = new xmldb_field('targetversion', XMLDB_TYPE_CHAR, '100', null, null, null, null, 'version');

          Show
          Arunas added a comment - Same issue when upgrading from '1.9.11+ (Build: 20110427)' $version = 2007101591.02; to 2.0.2 (Build: 20110221) version = 2011022100.00. The issue seems to be the lib\db\upgrade.php file where this couple code snapshots reside (same issue with message_processing, message_working) and other issues: if ($oldversion < 2008030600) { //NOTE: this table was added much later later in dev cycle, but we need it here, upgrades from pre PR1 not supported /// Define table upgrade_log to be created $table = new xmldb_table('upgrade_log'); ........................................ if ($oldversion < 2011020200.01) { // Define field targetversion to be added to upgrade_log $table = new xmldb_table('upgrade_log'); $field = new xmldb_field('targetversion', XMLDB_TYPE_CHAR, '100', null, null, null, null, 'version');
          Hide
          Arunas added a comment -

          More Clashes than reported before... many tables and records exist that supposelly should be created by 2.0.x installation script. I was able to remove either data fields and let recreate by upgrade script or removing the creation of tables in the upgrade script itself. Upgrade took about 2-3 days and now many things are missing in courses itself.

          Show
          Arunas added a comment - More Clashes than reported before... many tables and records exist that supposelly should be created by 2.0.x installation script. I was able to remove either data fields and let recreate by upgrade script or removing the creation of tables in the upgrade script itself. Upgrade took about 2-3 days and now many things are missing in courses itself.
          Michael de Raadt made changes -
          Fix Version/s STABLE backlog [ 10463 ]
          Priority Blocker [ 1 ] Critical [ 2 ]
          Labels triaged
          Michael de Raadt made changes -
          Link This issue has been marked as being related by MDL-22414 [ MDL-22414 ]
          Petr Škoda made changes -
          Assignee moodle.com [ moodle.com ] Petr Škoda (skodak) [ skodak ]
          Hide
          Petr Škoda added a comment -

          Hello,
          bugs like this are often caused by invalid PHP files in your installation, please use the latest weekly (remove all previous files PHP and keep only the config.php)

          This is most probably an installation problem, please use moodle.org forums for general support. Thanks

          Petr

          Show
          Petr Škoda added a comment - Hello, bugs like this are often caused by invalid PHP files in your installation, please use the latest weekly (remove all previous files PHP and keep only the config.php) This is most probably an installation problem, please use moodle.org forums for general support. Thanks Petr
          Petr Škoda made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Fix Version/s STABLE backlog [ 10463 ]
          Resolution Cannot Reproduce [ 5 ]
          Hide
          Achilles Poloynis added a comment -

          I'm having the same issue, even after using the latest 2.0 files with only the old config.
          Upgrading Moodle database from version 1.9.9 (Build: 20100609) (2008070701) to 2.0.5+ (Build: 20111102) (2011033005.05)

          The following error messages occur

          Table "message_processors" already exists

          and

          line 469 of /lib/ddl/database_manager.php: ddl_exception thrown
          line 336 of /lib/db/upgrade.php: call to database_manager->create_table()
          line 1384 of /lib/upgradelib.php: call to xmldb_main_upgrade()
          line 273 of /admin/index.php: call to upgrade_core()

          Show
          Achilles Poloynis added a comment - I'm having the same issue, even after using the latest 2.0 files with only the old config. Upgrading Moodle database from version 1.9.9 (Build: 20100609) (2008070701) to 2.0.5+ (Build: 20111102) (2011033005.05) The following error messages occur Table "message_processors" already exists and line 469 of /lib/ddl/database_manager.php: ddl_exception thrown line 336 of /lib/db/upgrade.php: call to database_manager->create_table() line 1384 of /lib/upgradelib.php: call to xmldb_main_upgrade() line 273 of /admin/index.php: call to upgrade_core()
          Hide
          Mignonne Davis added a comment -

          I had this problem trying to upgrade from 1.9 to 2.0. I gave up on 2.0 and instead upgraded to 2.1
          That went great except for a few database errors which were easy to fix. 2.1 seems a lot better in general than 2.0 anyway. I would suggest trying that instead.

          Show
          Mignonne Davis added a comment - I had this problem trying to upgrade from 1.9 to 2.0. I gave up on 2.0 and instead upgraded to 2.1 That went great except for a few database errors which were easy to fix. 2.1 seems a lot better in general than 2.0 anyway. I would suggest trying that instead.
          Hide
          Achilles Poloynis added a comment -

          Thank you for the reply.

          The documentation said upgrades had to be incremental(1.9 -> 2.0 -> 2.1) is that not really the case?

          Show
          Achilles Poloynis added a comment - Thank you for the reply. The documentation said upgrades had to be incremental(1.9 -> 2.0 -> 2.1) is that not really the case?
          Hide
          Mignonne Davis added a comment -

          No, not for me. And I was upgrading a large site with hundred of courses and thousands of users.
          Would it be helpful to you if I sent you the steps I used in getting things to work?

          Show
          Mignonne Davis added a comment - No, not for me. And I was upgrading a large site with hundred of courses and thousands of users. Would it be helpful to you if I sent you the steps I used in getting things to work?
          Hide
          Achilles Poloynis added a comment -

          Actually yes, I would really appreciate that. I was hopeful that I would fix the issue starting fresh but I'm still running into the same error as long as I use my existing database.

          Thank you.

          Show
          Achilles Poloynis added a comment - Actually yes, I would really appreciate that. I was hopeful that I would fix the issue starting fresh but I'm still running into the same error as long as I use my existing database. Thank you.
          Hide
          Achilles Poloynis added a comment -

          I am having the same issue trying to upgrade to the latest release of moodle 2.1

          Show
          Achilles Poloynis added a comment - I am having the same issue trying to upgrade to the latest release of moodle 2.1
          Mignonne Davis made changes -
          Attachment instructionsfor2.1.txt [ 25840 ]
          Mignonne Davis made changes -
          Attachment instructionsfor2.1.txt [ 25841 ]

            People

            • Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: