Moodle
  1. Moodle
  2. MDL-25866

Migrating/upgrading 1.9.5+ to 2.0.1+

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.0.1
    • Fix Version/s: None
    • Component/s: Unknown
    • Labels:
    • Environment:
      Ubunutu 10.04 Lucid
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_20_STABLE
    • Rank:
      15252

      Description

      I've performed countless migrations to a new dev server and upgrading from 1.9.5+ to 2.0+. Just tried the same steps I've been using to do that migration and upgrade to perform the 1.9.5+ to 2.0.1+ (Latest CVS HEAD-DEV) and my upgrade keeps failing with the error below during this SQL command.

      mysql> show full processlist;
      -------------------------------------------------------------------------------------------------------+

      Id User Host db Command Time State Info

      -------------------------------------------------------------------------------------------------------+

      1115 root localhost coursesites Query 988 Updating UPDATE mdl_backup_log SET backuptype='scheduledbackup'

      Upgrade timed out, please restart the upgrade.
      More information about this error
      Stack trace: •line 421 of /lib/setuplib.php: moodle_exception thrown
      •line 7957 of /lib/moodlelib.php: call to print_error()
      •line 130 of /lib/upgradelib.php: call to upgrade_set_timeout()
      •line 1237 of /lib/db/upgrade.php: call to upgrade_main_savepoint()
      •line 1309 of /lib/upgradelib.php: call to xmldb_main_upgrade()
      •line 252 of /admin/index.php: call to upgrade_core()

      The table had 7 million records (Never delete history set) so I switched to keep 365 and it dropped to around 4 million records. When it was at 7 Million records it would halt and rollback at 6089924 row lock(s). I've tried this with Innodb Engine and MyISAM engine both fails.

      I also specified a couple of additional server config settings that I never had to make with the 2.0 upgrade.

      Set Apache Timeout to zero, was at 300 and upgrading just fine
      Set Innodb pool to 900M, wasn't specified before so default 8M was used

      Thanks!
      Aaron

        Activity

        Hide
        Eloy Lafuente (stronk7) added a comment -

        Hi Aaron, thanks for the report.

        Yes, that can be a really loooong operation specially if logs are never deleted / the site has thousands of courses.

        And there isn't much we can do but provide some big time (it defaults to 5mins) for the operation by performing one call to upgrade_set_timeout($seconds) before the update is executed.

        So, just to know one aprox. valid value... do you know how much time did upgrade run before getting that error? It could be a good base.

        Finally, note that the backup_log table isn't used anymore by Moodle 2.0, we just have kept it there for reference but surely will be dropped soon, so perhaps the definitive alternative can be to skip completely that upgrade step... uhm...

        Just checking the whole thing now... ciao

        Show
        Eloy Lafuente (stronk7) added a comment - Hi Aaron, thanks for the report. Yes, that can be a really loooong operation specially if logs are never deleted / the site has thousands of courses. And there isn't much we can do but provide some big time (it defaults to 5mins) for the operation by performing one call to upgrade_set_timeout($seconds) before the update is executed. So, just to know one aprox. valid value... do you know how much time did upgrade run before getting that error? It could be a good base. Finally, note that the backup_log table isn't used anymore by Moodle 2.0, we just have kept it there for reference but surely will be dropped soon, so perhaps the definitive alternative can be to skip completely that upgrade step... uhm... Just checking the whole thing now... ciao
        Hide
        Bob Sather added a comment -

        Eloy -

        I've done a clean load of 2.01. I backed up a file in 1.98 to zip and loaded to 2.01.
        I've tried to restore the course from Front Page as an admin and from within the course as a Teacher using Restore.
        I get this message: The backup file was created with Moodle 1.x and can not currently be restored in Moodle 2. This functionality is coming in a future update

        We were planning on going live with 2.01 mid-February. This is a show stopper unless you have a work-around.

        Show
        Bob Sather added a comment - Eloy - I've done a clean load of 2.01. I backed up a file in 1.98 to zip and loaded to 2.01. I've tried to restore the course from Front Page as an admin and from within the course as a Teacher using Restore. I get this message: The backup file was created with Moodle 1.x and can not currently be restored in Moodle 2. This functionality is coming in a future update We were planning on going live with 2.01 mid-February. This is a show stopper unless you have a work-around.
        Hide
        Aaron Cowell added a comment -

        Eloy,

        Thanks I do understand that this is not specifically a problem and that it takes a long time to process this table. The timeout must have recently been set or something else changed between 2.0 and 2.0.1 because I've completed this successfully several times before with the same amount of records. It did take nearly an hour and a half to do the full upgrade before but it did complete without errors none-the-less. I'm resetting everything and preparing to re-run the upgrade now and will try to get you a good time frame of when this error occurs after clicking upgrade.

        Thanks!
        Aaron

        Show
        Aaron Cowell added a comment - Eloy, Thanks I do understand that this is not specifically a problem and that it takes a long time to process this table. The timeout must have recently been set or something else changed between 2.0 and 2.0.1 because I've completed this successfully several times before with the same amount of records. It did take nearly an hour and a half to do the full upgrade before but it did complete without errors none-the-less. I'm resetting everything and preparing to re-run the upgrade now and will try to get you a good time frame of when this error occurs after clicking upgrade. Thanks! Aaron
        Hide
        Eloy Lafuente (stronk7) added a comment -

        I'm closing this as cannot reproduce as far as the backup_log table was dropped from Moodle before 2.2 and the loooong upgrade step was also deleted, so anybody upgrading from 1.9.x to 2.2.x to 2.current won't experiment that problem anymore.

        Show
        Eloy Lafuente (stronk7) added a comment - I'm closing this as cannot reproduce as far as the backup_log table was dropped from Moodle before 2.2 and the loooong upgrade step was also deleted, so anybody upgrading from 1.9.x to 2.2.x to 2.current won't experiment that problem anymore.

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: