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

Moodle 1.9.11 to Moodle 2.0 Upgrade DDL Execution error - mdl_backup_log

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0.4, 2.1.1, 2.2
    • Fix Version/s: 2.0.5, 2.1.2
    • Component/s: Backup
    • Labels:
    • Environment:
      Windows r2 s008, MS-SQL 2008, IIS 7.5. PHP 5.3.5 FastCGI

      Description

      When trying to do the upgrade from Moodle 1.9.11 to Moodle 2.0 I get an DDL Execution Error.

      It is at the

      ALTER TABLE mdl_backup_log

      It tries to add a new column backuptype nvarchar(50) Not Null

      The work around is to add the new column manually prior to upgrade.

      add the new column backuptype nvarchar(50 and set the default ''

      The upgrade can then proceed.

      However, probably better if it was fixed the upgrade script.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              fweiss Fred Weiss added a comment - - edited

              Refer forum item below for full error message;

              http://moodle.org/mod/forum/discuss.php?d=164042

              Show
              fweiss Fred Weiss added a comment - - edited Refer forum item below for full error message; http://moodle.org/mod/forum/discuss.php?d=164042
              Hide
              samhemelryk Sam Hemelryk added a comment -

              Thanks for reporting the issue Fred.

              Eloy, could you please have a look at the attached patch and let me know if it makes sense. I don't have any spare machines to install Windows+MSSQL on presently to test the solution however it appears the problem is pretty obvious.
              If you are happy with it I'll get the boys in Perth to test it out for me.

              Cheers
              Sam

              Show
              samhemelryk Sam Hemelryk added a comment - Thanks for reporting the issue Fred. Eloy, could you please have a look at the attached patch and let me know if it makes sense. I don't have any spare machines to install Windows+MSSQL on presently to test the solution however it appears the problem is pretty obvious. If you are happy with it I'll get the boys in Perth to test it out for me. Cheers Sam
              Hide
              andyjdavis Andrew Davis added a comment - - edited

              That looks fine I guess. Is there a meaningful default we could add and then leave on the field?

              And you will of course need some testing instructions.

              Show
              andyjdavis Andrew Davis added a comment - - edited That looks fine I guess. Is there a meaningful default we could add and then leave on the field? And you will of course need some testing instructions.
              Hide
              stronk7 Eloy Lafuente (stronk7) added a comment -

              Hi,

              the fix seems perfect, but the key here is that the backup_log table is not used any more since 2.0 (see MDL-22274 about it).

              I kept it there just in case somebody wanted to access to historical data for any reason, but surely we can take rid of it completely.

              What if:

              1) for 20, 21 and master, we apply your patch right now (will fix this problem, although really it has NO use under 2.x).
              2) for master, we take rid of the table completely, deleting any use everywhere and adding upgrade step about to drop it (MDL-22274)

              Show
              stronk7 Eloy Lafuente (stronk7) added a comment - Hi, the fix seems perfect, but the key here is that the backup_log table is not used any more since 2.0 (see MDL-22274 about it). I kept it there just in case somebody wanted to access to historical data for any reason, but surely we can take rid of it completely. What if: 1) for 20, 21 and master, we apply your patch right now (will fix this problem, although really it has NO use under 2.x). 2) for master, we take rid of the table completely, deleting any use everywhere and adding upgrade step about to drop it ( MDL-22274 )
              Hide
              samhemelryk Sam Hemelryk added a comment -

              Sounds great to me Eloy, I'll put this issue up for integration now and create a new issue now to see the backup_log table removed from master.

              Cheers
              Sam

              Show
              samhemelryk Sam Hemelryk added a comment - Sounds great to me Eloy, I'll put this issue up for integration now and create a new issue now to see the backup_log table removed from master. Cheers Sam
              Hide
              stronk7 Eloy Lafuente (stronk7) added a comment -

              The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

              TIA and ciao

              Show
              stronk7 Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
              Hide
              samhemelryk Sam Hemelryk added a comment -

              Created MDL-29185 to remove the backup_log table.

              Show
              samhemelryk Sam Hemelryk added a comment - Created MDL-29185 to remove the backup_log table.
              Hide
              nebgor Aparup Banerjee added a comment -

              Thanks all, this has been integrated now!

              Show
              nebgor Aparup Banerjee added a comment - Thanks all, this has been integrated now!
              Hide
              nebgor Aparup Banerjee added a comment -

              yup works fine for me. column was added too.

              Show
              nebgor Aparup Banerjee added a comment - yup works fine for me. column was added too.
              Hide
              stronk7 Eloy Lafuente (stronk7) added a comment -

              git & cvs repositories updated with your gorgeous code. Many thanks!

              Closing and ciao

              Show
              stronk7 Eloy Lafuente (stronk7) added a comment - git & cvs repositories updated with your gorgeous code. Many thanks! Closing and ciao

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    10/Oct/11