Uploaded image for project: 'LAMS Development'
  1. LAMS Development
  2. LDEV-2733

Upgrade 2.3.5 -> 2.4: Autopatch shows errors when upgrading database

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.4
    • Component/s: General
    • Labels:
      None

      Description

      This issue is a part of upgrade LAMS from 2.3.5 to 2.4.
      When having a database from 2.3.5 version and trying to start LAMS 2.4, autopatch executes SQL scripts.
      This process should leave the DB structure ready for the new version.
      Currently it shows errors and only manual execution of following queries allows LAMS server to start:

      drop table lams_planner_node_role;
      delete from lams_configuration where config_key = 'InternalSMTPServer';
      delete from lams_configuration where config_key = 'ShowAllMyLessonLink';
      drop table lams_timezone;

      These should not be needed, autopatch should take care of everything automatically.

        Activity

        Hide
        marcin Marcin Cieslak added a comment -
        Errors come from SQL patch scripts which are trying to execute invalid queries.

        First problem encountered, which is not described in the original JIRA description, is attempt to execute in script "patch02040001.sql" query:
        DROP TABLE lams_css_property;
        while that table does not exists. Comment in the scripts informs it is bound with LDEV-2420.

        LAMS 2.3.5 does not have this table in the original structure created by "create_lams_11_tables.sql", so there is nothing to drop.

        In lams_2_3_5 tag there is also script "patch02030402.sql" which executes the same "drop table" queries and it's marked as bound with LDEV-2517,
        but this script is executed when upgrading *to* 2.3.5 version, not *from* 2.3.5.

        Suggested solution is to remove "patch02040001.sql" from LAMS 2.4 because the DB has the necessary structure already and does not need patching.
        Show
        marcin Marcin Cieslak added a comment - Errors come from SQL patch scripts which are trying to execute invalid queries. First problem encountered, which is not described in the original JIRA description, is attempt to execute in script "patch02040001.sql" query: DROP TABLE lams_css_property; while that table does not exists. Comment in the scripts informs it is bound with LDEV-2420 . LAMS 2.3.5 does not have this table in the original structure created by "create_lams_11_tables.sql", so there is nothing to drop. In lams_2_3_5 tag there is also script "patch02030402.sql" which executes the same "drop table" queries and it's marked as bound with LDEV-2517 , but this script is executed when upgrading *to* 2.3.5 version, not *from* 2.3.5. Suggested solution is to remove "patch02040001.sql" from LAMS 2.4 because the DB has the necessary structure already and does not need patching.
        Hide
        marcin Marcin Cieslak added a comment -
        Next problem comes from "patch02040003.sql"script which tries to execute
        CREATE TABLE lams_planner_node_role...
        but the table already exists.

        Andrey has already added this table in 2.3.5 DB structure, following LDEV-2515.
        See revision 1.138.2.6.2.2 of "create_lams_11_tables.sql".

        Suggested solution is to remove "patch02040003.sql" from LAMS 2.4 because the DB has the necessary structure already and does not need patching.
        Show
        marcin Marcin Cieslak added a comment - Next problem comes from "patch02040003.sql"script which tries to execute CREATE TABLE lams_planner_node_role... but the table already exists. Andrey has already added this table in 2.3.5 DB structure, following LDEV-2515 . See revision 1.138.2.6.2.2 of "create_lams_11_tables.sql". Suggested solution is to remove "patch02040003.sql" from LAMS 2.4 because the DB has the necessary structure already and does not need patching.
        Hide
        marcin Marcin Cieslak added a comment -
        Problem with "InternalSMTPServer" configuration entry comes from "patch02040005.sql" file.

        Andrey has already added this entry in 2.3.5 DB configuration, following LDEV-2509.
        See revision 1.35.4.4.2.4 of "insert_lams_windows_config_data.sql":
        http://lamscvs.melcoe.mq.edu.au/fisheye/browse/lams/lams_common/db/sql/insert_lams_windows_config_data.sql#r1.35.4.4.2.4

        Suggested solution is to remove "patch02040005.sql" from LAMS 2.4 because the DB has the necessary configuration already and does not need patching.
        Show
        marcin Marcin Cieslak added a comment - Problem with "InternalSMTPServer" configuration entry comes from "patch02040005.sql" file. Andrey has already added this entry in 2.3.5 DB configuration, following LDEV-2509 . See revision 1.35.4.4.2.4 of "insert_lams_windows_config_data.sql": http://lamscvs.melcoe.mq.edu.au/fisheye/browse/lams/lams_common/db/sql/insert_lams_windows_config_data.sql#r1.35.4.4.2.4 Suggested solution is to remove "patch02040005.sql" from LAMS 2.4 because the DB has the necessary configuration already and does not need patching.
        Hide
        marcin Marcin Cieslak added a comment -
        Problem with "ShowAllMyLessonLink" configuration entry comes from "patch02040006.sql" file.

        Andrey has already added this entry in 2.3.5 DB configuration, following LDEV-2564.
        See revision 1.35.4.4.2.3 of "insert_lams_windows_config_data.sql":
        http://lamscvs.melcoe.mq.edu.au/fisheye/browse/lams/lams_common/db/sql/insert_lams_windows_config_data.sql#r1.35.4.4.2.3

        Suggested solution is... guess what?
        Show
        marcin Marcin Cieslak added a comment - Problem with "ShowAllMyLessonLink" configuration entry comes from "patch02040006.sql" file. Andrey has already added this entry in 2.3.5 DB configuration, following LDEV-2564 . See revision 1.35.4.4.2.3 of "insert_lams_windows_config_data.sql": http://lamscvs.melcoe.mq.edu.au/fisheye/browse/lams/lams_common/db/sql/insert_lams_windows_config_data.sql#r1.35.4.4.2.3 Suggested solution is... guess what?
        Hide
        marcin Marcin Cieslak added a comment -
        I encountered no problems with lams_timezone table when starting LAMS server, so no
        drop table lams_timezone;
        query was needed.
        Show
        marcin Marcin Cieslak added a comment - I encountered no problems with lams_timezone table when starting LAMS server, so no drop table lams_timezone; query was needed.
        Hide
        ernieg Ernie Ghiglione added a comment -
        Marcin, please commit your changes as you think. I'll do testing later on and let you know of any issues.
        Show
        ernieg Ernie Ghiglione added a comment - Marcin, please commit your changes as you think. I'll do testing later on and let you know of any issues.
        Hide
        marcin Marcin Cieslak added a comment -
        Fixed. New issues with autopatch will be described in separate JIRAs.
        Show
        marcin Marcin Cieslak added a comment - Fixed. New issues with autopatch will be described in separate JIRAs.

          People

          • Assignee:
            marcin Marcin Cieslak
            Reporter:
            marcin Marcin Cieslak
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development