- Recommended to have MDK installed.
- Multiple PHP versions available:
- Moodle 3.3 only supports up to PHP 7.0.
- For Moodle 3.5 and up parts of the test, you may switch to PHP 7.2.
Prerequisites Recommended to have MDK installed. Multiple PHP versions available: Moodle 3.3 only supports up to PHP 7.0. For Moodle 3.5 and up parts of the test, you may switch to PHP 7.2. Upgrade test Switch to PHP 7.0 Make a fresh installation of Moodle 3.3.7 git checkout v3.3.7 mdk install Clone the data privacy tool git clone firstname.lastname@example.org:moodlehq/moodle-tool_dataprivacy.git admin/tool/dataprivacy Check out the 33.1.0 version of the tool. cd admin/tool/dataprivacy git checkout 33.1.0 Install the tool by upgrading the site. php admin/cli/upgrade.php Delete the tool's folder rm -rf admin/tool/dataprivacy Switch to PHP 7.2 Check out and upgrade your site to Moodle 3.5.0 (You need to do so before you can install higher versions of Moodle) git checkout v3.5.0 php admin/cli/upgrade.php Check out the branch you're testing with this patch applied (e.g. " git checkout MOODLE_35_STABLE ") Upgrade your site. php admin/cli/upgrade.php Confirm that the upgrade completes successfully. Check the database schema. php admin/cli/check_database_schema.php Confirm that you get the message " Database structure is ok. "
- Switch to PHP 7.0
- Make a fresh installation of Moodle 3.3.7
- Clone the data privacy tool
- Check out the 33.1.0 version of the tool.
- Install the tool by upgrading the site.
- Delete the tool's folder
- Switch to PHP 7.2
- Check out and upgrade your site to Moodle 3.5.0 (You need to do so before you can install higher versions of Moodle)
- Check out the branch you're testing with this patch applied (e.g. "git checkout MOODLE_35_STABLE")
- Upgrade your site.
- Confirm that the upgrade completes successfully.
- Check the database schema.
- Confirm that you get the message "Database structure is ok."
On a Moodle site which has used the standalone GDPR plugins on Moodle 3.4.x upgrading to Moodle 3.9 fails
DDL sql execution error
More information about this error
×Debug info: Unknown column 'dpocommentformat' in 'mdl_tool_dataprivacy_request'
ALTER TABLE mdl_tool_dataprivacy_request ADD systemapproved SMALLINT(4) NOT NULL DEFAULT 0 AFTER dpocommentformat
Error code: ddlexecuteerror
×Stack trace: * line 492 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown
- line 1098 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
- line 77 of /lib/ddl/database_manager.php: call to mysqli_native_moodle_database->change_database_structure()
- line 547 of /lib/ddl/database_manager.php: call to database_manager->execute_sql_arr()
- line 333 of /admin/tool/dataprivacy/db/upgrade.php: call to database_manager->add_field()
- line 692 of /lib/upgradelib.php: call to xmldb_tool_dataprivacy_upgrade()
- line 1917 of /lib/upgradelib.php: call to upgrade_plugins()
- line 711 of /admin/index.php: call to upgrade_noncore()
This is due to
MDL-66752 relying on the "dpocommentformat" column - https://github.com/moodle/moodle/blame/MOODLE_39_STABLE/admin/tool/dataprivacy/db/upgrade.php#L329
Looking through the git history the dpocommentformat was added to the install.xml under
MDL-61899 -https://github.com/moodle/moodle/blame/MOODLE_39_STABLE/admin/tool/dataprivacy/db/install.xml#L18 but no upgrade step was added during the integration from contrib to core.
Interestingly the upgrade step omission had actually been picked upon but never resolved.