Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-27265

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 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

      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.

        Gliffy Diagrams

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

          Issue Links

            Activity

            Hide
            arunciks 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
            arunciks 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
            arunciks 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
            arunciks 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.
            Hide
            skodak Petr Skoda 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
            skodak Petr Skoda 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
            Hide
            aheleos 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
            aheleos 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 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 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
            aheleos 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
            aheleos 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 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 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
            aheleos 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
            aheleos 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
            aheleos Achilles Poloynis added a comment -

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

            Show
            aheleos Achilles Poloynis added a comment - I am having the same issue trying to upgrade to the latest release of moodle 2.1

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: