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

Azure SQL version information - move env. checks to use COMPATIBILITY_LEVEL

XMLWordPrintable

    • MOODLE_311_STABLE
    • MDL-72535-master
    • Hide

      Prerequisites

      • Web server pre-configured with SQL Server PHP drivers and ready for Moodle installation
      • Empty SQL Server database prepared for Moodle installation (either SQL Server 2017/2019 or Azure SQL is fine)

      Addition setup information (Feel free use your preferred one, this is the one I followed)

      • Moodle docker (https://github.com/moodlehq/moodle-docker) is available to setup the environment.
      • Clone repo, get the moodle code inside docker as instructed, add the config to siteroot.
      • Exposing the port for accessing: Change the following in db.mssql.port.yml:

      version: "2"
      services:
        db:
          ports:
            - "${MOODLE_DOCKER_DB_PORT}:1433/tcp"
          expose:
            - '1433'
      

      * Run the following for initial setup
      export MOODLE_DOCKER_WWWROOT=location_of_the_siteroot && export MOODLE_DOCKER_BROWSER=firefox && export MOODLE_DOCKER_DB=mssql && export MOODLE_DOCKER_DB_PORT=1433

      • Start the containers
        bin/moodle-docker-compose up -d && bin/moodle-docker-wait-for-db
      • Access the database
        • Host: localhost or 127.0.0.1
        • Port: 1433
        • User: sa
        • Password: m@0dl3ing
        • Database: moodle
        • Data source in client: Microsoft SQL Server

       

      Test scenario 1:

      1. Clone the moodle repo using master branch
      2. Either during or immediately after database creation, issue the following T-SQL command to set the database compatibility to SQL Server 2008, which is the minimum compatibility level allowed on modern versions of SQL Server and in Azure SQL:
        ALTER DATABASE database_name SET COMPATIBILITY_LEVEL = 100;
      3. Attempt Moodle installation.
      4. Confirm that it will fail indicating to check the database.
      5. Run the following T-SQL command on the database to match the minimum database server version required for Moodle 3.11 and 4.0, which is SQL Server 2017:
        ALTER DATABASE database_name SET COMPATIBILITY_LEVEL = 140;
      6. Attempt Moodle installation again (or refresh the requirements list if installing via a web browser).
      7. Confirm that the installation will proceed and complete correctly.

      Repeat the test for 4.0, 4.1 and 3.11

       

      Test scenario 2:

      1. Either during or immediately after database creation, issue the following T-SQL command to set the database compatibility to SQL Server 2008, which is the minimum compatibility level allowed on modern versions of SQL Server and in Azure SQL:
        ALTER DATABASE database_name SET COMPATIBILITY_LEVEL = 100;
      2. Attempt Moodle installation.
      3. Confirm that it will fail indicating to check the database.
      4. Run the following T-SQL command on the database to match the minimum database server version required for Moodle 3.9, which is SQL Server 2012:
        ALTER DATABASE database_name SET COMPATIBILITY_LEVEL = 110;
      5. Attempt Moodle installation again (or refresh the requirements list if installing via a web browser). Installation will proceed and complete correctly. Complete the installation.
      6. Log into Moodle 3.9 with site administrator credentials.
      7. Visit Site Administration > Server > Environment (admin/environment.php). Note that, for 3.9, the server requirements are met.
      8. Switch to view 3.11 or 4.0+ requirements. Note the database server requirements are not met.
      9. Run the following T-SQL command on the database to match the minimum database server version required for Moodle 3.11 and 4.0, which is SQL Server 2017:
        ALTER DATABASE database_name SET COMPATIBILITY_LEVEL = 140;
        (You also can set it to 150, which is SQL Server 2019 and most current.)
      10. Refresh the environment page for Moodle 3.11 or 4.0+. Note the database server requirements are met.
      11. Confirm that the upgrade will proceed and complete correctly.
      Show
      Prerequisites Web server pre-configured with SQL Server PHP drivers and ready for Moodle installation Empty SQL Server database prepared for Moodle installation (either SQL Server 2017/2019 or Azure SQL is fine) Addition setup information (Feel free use your preferred one, this is the one I followed) Moodle docker ( https://github.com/moodlehq/moodle-docker) is available to setup the environment. Clone repo, get the moodle code inside docker as instructed, add the config to siteroot. Exposing the port for accessing: Change the following in db.mssql.port.yml : version: "2" services: db: ports: - "${MOODLE_DOCKER_DB_PORT}:1433/tcp" expose: - '1433' * Run the following for initial setup export MOODLE_DOCKER_WWWROOT=location_of_the_siteroot && export MOODLE_DOCKER_BROWSER=firefox && export MOODLE_DOCKER_DB=mssql && export MOODLE_DOCKER_DB_PORT=1433 Start the containers bin/moodle-docker-compose up -d && bin/moodle-docker-wait-for-db Access the database Host: localhost or 127.0.0.1 Port: 1433 User: sa Password: m@0dl3ing Database: moodle Data source in client: Microsoft SQL Server   Test scenario 1: Clone the moodle repo using master branch Either during or immediately after database creation, issue the following T-SQL command to set the database compatibility to SQL Server 2008, which is the minimum compatibility level allowed on modern versions of SQL Server and in Azure SQL: ALTER DATABASE database_name SET COMPATIBILITY_LEVEL = 100; Attempt Moodle installation. Confirm that it will fail indicating to check the database. Run the following T-SQL command on the database to match the minimum database server version required for Moodle 3.11 and 4.0, which is SQL Server 2017: ALTER DATABASE database_name SET COMPATIBILITY_LEVEL = 140; Attempt Moodle installation again (or refresh the requirements list if installing via a web browser). Confirm that the installation will proceed and complete correctly. Repeat the test for 4.0, 4.1 and 3.11   Test scenario 2: Either during or immediately after database creation, issue the following T-SQL command to set the database compatibility to SQL Server 2008, which is the minimum compatibility level allowed on modern versions of SQL Server and in Azure SQL: ALTER DATABASE database_name SET COMPATIBILITY_LEVEL = 100; Attempt Moodle installation. Confirm that it will fail indicating to check the database. Run the following T-SQL command on the database to match the minimum database server version required for Moodle 3.9, which is SQL Server 2012: ALTER DATABASE database_name SET COMPATIBILITY_LEVEL = 110; Attempt Moodle installation again (or refresh the requirements list if installing via a web browser). Installation will proceed and complete correctly. Complete the installation. Log into Moodle 3.9 with site administrator credentials. Visit Site Administration > Server > Environment ( admin/environment.php ). Note that, for 3.9, the server requirements are met. Switch to view 3.11 or 4.0+ requirements. Note the database server requirements are not met. Run the following T-SQL command on the database to match the minimum database server version required for Moodle 3.11 and 4.0, which is SQL Server 2017: ALTER DATABASE database_name SET COMPATIBILITY_LEVEL = 140; (You also can set it to 150, which is SQL Server 2019 and most current.) Refresh the environment page for Moodle 3.11 or 4.0+. Note the database server requirements are met. Confirm that the upgrade will proceed and complete correctly.
    • 6
    • Team Hedgehog Sprint 1.3, Team Hedgehog Sprint 1 review

      We have been running Moodle on Azure SQL for over a year now without issue and we are currently at v3.10.6+ but we have found that the pre-upgrade SQL version check for Moodle 3.11+ and Moodle 4 fails and mistakenly reports that we are running SQL 12.00.2000.  Apparently, this pre-upgrade SQL version check does not work correctly against Azure SQL for some reason.  We have verified that our Azure SQL version is at SQL 2019 (I have a screenshot).   And when I click on the database server check report link in Moodle ('version 14.0 is required and you are running 12.00.2000') - I get an error "This page does not exist yet".  We would really like to stay with Azure SQL and are requesting that the pre-upgrade check be fixed to correctly report against Azure SQL so we can continue to install Moodle upgrades as they become available.

            Unassigned Unassigned
            thomas-its Thomas College ITS
            Votes:
            6 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 6 hours, 5 minutes
                6h 5m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.