OS: Windows 11 Pro
I'm getting a new error message, "Unknow DDL library error," when I try to upgrade from 3.11.5+ to 4.1.1+. Ideas?
The upgrade is trying to populate a table which should not exist in a Moodle 3.11 database. But because it both exists and is populated – probably from an earlier upgrade attempt – this error occurs.
Presumably the previous upgrade was backed out by an attempt to restore the previous Moodle version's database. But because MySQL/MariaDB leaves behind any new (i.e. Moodle 4.0) tables during restore this restore is invalid. Instead one must delete and recreate the database – or manually delete all tables – before restoring in order to return to the situation before the upgrade attempt.
See also this reply or this reply.
Assuming you have the Moodle 3.11 database backup from from before the upgrade then yes, you should be able to 1) delete all the tables from the Moodle database, 2) restore the 3.11 database backup, then 3) try the upgrade again.
I would advise taking database backup before deleting the tables as even though the database is in a non-usable state it makes sense to be cautious when making such changes.
Again, this is based on my guess of what's led to the error in your screenshot: that the database currently has a mix of 3.11 tables and new 4.1 tables from a previous upgrade attempt.
Is there any way to determine which tables are from the 4.1.1+ upgrade attempt, and just delete those tables??
You could install a 3.11 site, get a list of the tables, then upgrade it to 4.1 and compare the list of tables. But I don't think that will help solve this error as the upgrade's "checkpoint" – the saved progress through the upgrade – won't get reset by deleting new tables. It's possible you would just get a different error because from the checkpoint Moodle will expect to be partially through the upgrade.
It is possible to unravel the checkpoint by working out where the upgrade has got to and manually alter the database to align with the expected state. But if you have the 3.11 database backup then if you restore this into an empty database the upgrade should work.
If you're still having trouble it may help if you explain more about what led up to the current status.
(For what it's worth I've attached a list of new tables based on a quick upgrade of a test site from 3.11 to 4.1).
3.11.12+ (Build: 20230120)
A few plugins - mostly stock.
Tables_in_moodle311
mdl_analytics_indicator_calc
mdl_analytics_models
mdl_analytics_models_log
mdl_analytics_predict_samples
mdl_analytics_prediction_actions
mdl_analytics_predictions
mdl_analytics_train_samples
mdl_analytics_used_analysables
mdl_analytics_used_files
mdl_assign
mdl_assign_grades
mdl_assign_overrides
mdl_assign_plugin_config
mdl_assign_submission
mdl_assign_user_flags
mdl_assign_user_mapping
mdl_assignfeedback_comments
mdl_assignfeedback_editpdf_annot
mdl_assignfeedback_editpdf_cmnt
mdl_assignfeedback_editpdf_queue
mdl_assignfeedback_editpdf_quick
mdl_assignfeedback_editpdf_rot
mdl_assignfeedback_file
mdl_assignment
mdl_assignment_submissions
mdl_assignment_upgrade
mdl_assignsubmission_file
mdl_assignsubmission_onlinetext
mdl_auth_oauth2_linked_login
mdl_backup_controllers
mdl_backup_courses
mdl_backup_logs
mdl_badge
mdl_badge_alignment
mdl_badge_backpack
mdl_badge_backpack_oauth2
mdl_badge_criteria
mdl_badge_criteria_met
mdl_badge_criteria_param
mdl_badge_endorsement
mdl_badge_external
mdl_badge_external_backpack
mdl_badge_external_identifier
mdl_badge_issued
mdl_badge_manual_award
mdl_badge_related
mdl_block
mdl_block_instances
mdl_block_positions
mdl_block_quickmail_alt_emails
mdl_block_quickmail_config
mdl_block_quickmail_draft_recips
mdl_block_quickmail_event_notifs
mdl_block_quickmail_event_recips
mdl_block_quickmail_messages
mdl_block_quickmail_msg_ad_email
mdl_block_quickmail_msg_attach
mdl_block_quickmail_msg_recips
mdl_block_quickmail_notifs
mdl_block_quickmail_rem_notifs
mdl_block_quickmail_schedules
mdl_block_quickmail_signatures
mdl_block_recent_activity
mdl_block_recentlyaccesseditems
mdl_block_rss_client
mdl_blog_association
mdl_blog_external
mdl_book
mdl_book_chapters
mdl_cache_filters
mdl_cache_flags
mdl_capabilities
mdl_chat
mdl_chat_messages
mdl_chat_messages_current
mdl_chat_users
mdl_choice
mdl_choice_answers
mdl_choice_options
mdl_cohort
mdl_cohort_members
mdl_comments
mdl_competency
mdl_competency_coursecomp
mdl_competency_coursecompsetting
mdl_competency_evidence
mdl_competency_framework
mdl_competency_modulecomp
mdl_competency_plan
mdl_competency_plancomp
mdl_competency_relatedcomp
mdl_competency_template
mdl_competency_templatecohort
mdl_competency_templatecomp
mdl_competency_usercomp
mdl_competency_usercompcourse
mdl_competency_usercompplan
mdl_competency_userevidence
mdl_competency_userevidencecomp
mdl_config
mdl_config_log
mdl_config_plugins
mdl_contentbank_content
mdl_context
mdl_context_temp
mdl_course
mdl_course_categories
mdl_course_completion_aggr_methd
mdl_course_completion_crit_compl
mdl_course_completion_criteria
mdl_course_completion_defaults
mdl_course_completions
mdl_course_format_options
mdl_course_modules
mdl_course_modules_completion
mdl_course_published
mdl_course_request
mdl_course_sections
mdl_customfield_category
mdl_customfield_data
mdl_customfield_field
mdl_data
mdl_data_content
mdl_data_fields
mdl_data_records
mdl_editor_atto_autosave
mdl_enrol
mdl_enrol_flatfile
mdl_enrol_lti_lti2_consumer
mdl_enrol_lti_lti2_context
mdl_enrol_lti_lti2_nonce
mdl_enrol_lti_lti2_resource_link
mdl_enrol_lti_lti2_share_key
mdl_enrol_lti_lti2_tool_proxy
mdl_enrol_lti_lti2_user_result
mdl_enrol_lti_tool_consumer_map
mdl_enrol_lti_tools
mdl_enrol_lti_users
mdl_enrol_paypal
mdl_event
mdl_event_subscriptions
mdl_events_handlers
mdl_events_queue
mdl_events_queue_handlers
mdl_external_functions
mdl_external_services
mdl_external_services_functions
mdl_external_services_users
mdl_external_tokens
mdl_favourite
mdl_feedback
mdl_feedback_completed
mdl_feedback_completedtmp
mdl_feedback_item
mdl_feedback_sitecourse_map
mdl_feedback_template
mdl_feedback_value
mdl_feedback_valuetmp
mdl_file_conversion
mdl_files
mdl_files_reference
mdl_filter_active
mdl_filter_config
mdl_filter_wiris_formulas
mdl_folder
mdl_format_menutopic
mdl_forum
mdl_forum_digests
mdl_forum_discussion_subs
mdl_forum_discussions
mdl_forum_grades
mdl_forum_posts
mdl_forum_queue
mdl_forum_read
mdl_forum_subscriptions
mdl_forum_track_prefs
mdl_glossary
mdl_glossary_alias
mdl_glossary_categories
mdl_glossary_entries
mdl_glossary_entries_categories
mdl_glossary_formats
mdl_grade_categories
mdl_grade_categories_history
mdl_grade_grades
mdl_grade_grades_history
mdl_grade_import_newitem
mdl_grade_import_values
mdl_grade_items
mdl_grade_items_history
mdl_grade_letters
mdl_grade_outcomes
mdl_grade_outcomes_courses
mdl_grade_outcomes_history
mdl_grade_settings
mdl_grading_areas
mdl_grading_definitions
mdl_grading_instances
mdl_gradingform_guide_comments
mdl_gradingform_guide_criteria
mdl_gradingform_guide_fillings
mdl_gradingform_rubric_criteria
mdl_gradingform_rubric_fillings
mdl_gradingform_rubric_levels
mdl_groupings
mdl_groupings_groups
mdl_groups
mdl_groups_members
mdl_h5p
mdl_h5p_contents_libraries
mdl_h5p_libraries
mdl_h5p_libraries_cachedassets
mdl_h5p_library_dependencies
mdl_h5pactivity
mdl_h5pactivity_attempts
mdl_h5pactivity_attempts_results
mdl_hvp
mdl_hvp_auth
mdl_hvp_content_hub_cache
mdl_hvp_content_user_data
mdl_hvp_contents_libraries
mdl_hvp_counters
mdl_hvp_events
mdl_hvp_libraries
mdl_hvp_libraries_cachedassets
mdl_hvp_libraries_hub_cache
mdl_hvp_libraries_languages
mdl_hvp_libraries_libraries
mdl_hvp_tmpfiles
mdl_hvp_xapi_results
mdl_imscp
mdl_infected_files
mdl_label
mdl_lesson
mdl_lesson_answers
mdl_lesson_attempts
mdl_lesson_branch
mdl_lesson_grades
mdl_lesson_overrides
mdl_lesson_pages
mdl_lesson_timer
mdl_license
mdl_lock_db
mdl_log
mdl_log_display
mdl_log_queries
mdl_logstore_standard_log
mdl_lti
mdl_lti_access_tokens
mdl_lti_submission
mdl_lti_tool_proxies
mdl_lti_tool_settings
mdl_lti_types
mdl_lti_types_config
mdl_ltiservice_gradebookservices
mdl_message
mdl_message_airnotifier_devices
mdl_message_contact_requests
mdl_message_contacts
mdl_message_conversation_actions
mdl_message_conversation_members
mdl_message_conversations
mdl_message_email_messages
mdl_message_popup
mdl_message_popup_notifications
mdl_message_processors
mdl_message_providers
mdl_message_read
mdl_message_user_actions
mdl_message_users_blocked
mdl_messageinbound_datakeys
mdl_messageinbound_handlers
mdl_messageinbound_messagelist
mdl_messages
mdl_mnet_application
mdl_mnet_host
mdl_mnet_host2service
mdl_mnet_log
mdl_mnet_remote_rpc
mdl_mnet_remote_service2rpc
mdl_mnet_rpc
mdl_mnet_service
mdl_mnet_service2rpc
mdl_mnet_session
mdl_mnet_sso_access_control
mdl_mnetservice_enrol_courses
mdl_mnetservice_enrol_enrolments
mdl_modules
mdl_my_pages
mdl_notifications
mdl_oauth2_access_token
mdl_oauth2_endpoint
mdl_oauth2_issuer
mdl_oauth2_refresh_token
mdl_oauth2_system_account
mdl_oauth2_user_field_mapping
mdl_page
mdl_paygw_paypal
mdl_payment_accounts
mdl_payment_gateways
mdl_payments
mdl_portfolio_instance
mdl_portfolio_instance_config
mdl_portfolio_instance_user
mdl_portfolio_log
mdl_portfolio_mahara_queue
mdl_portfolio_tempdata
mdl_post
mdl_profiling
mdl_qtype_ddimageortext
mdl_qtype_ddimageortext_drags
mdl_qtype_ddimageortext_drops
mdl_qtype_ddmarker
mdl_qtype_ddmarker_drags
mdl_qtype_ddmarker_drops
mdl_qtype_essay_options
mdl_qtype_match_options
mdl_qtype_match_subquestions
mdl_qtype_multichoice_options
mdl_qtype_randomsamatch_options
mdl_qtype_shortanswer_options
mdl_question
mdl_question_answers
mdl_question_attempt_step_data
mdl_question_attempt_steps
mdl_question_attempts
mdl_question_calculated
mdl_question_calculated_options
mdl_question_categories
mdl_question_dataset_definitions
mdl_question_dataset_items
mdl_question_datasets
mdl_question_ddwtos
mdl_question_gapselect
mdl_question_hints
mdl_question_multianswer
mdl_question_numerical
mdl_question_numerical_options
mdl_question_numerical_units
mdl_question_response_analysis
mdl_question_response_count
mdl_question_statistics
mdl_question_truefalse
mdl_question_usages
mdl_quiz
mdl_quiz_attempts
mdl_quiz_feedback
mdl_quiz_grades
mdl_quiz_overrides
mdl_quiz_overview_regrades
mdl_quiz_reports
mdl_quiz_sections
mdl_quiz_slot_tags
mdl_quiz_slots
mdl_quiz_statistics
mdl_quizaccess_seb_quizsettings
mdl_quizaccess_seb_template
mdl_rating
mdl_registration_hubs
mdl_repository
mdl_repository_instance_config
mdl_repository_instances
mdl_repository_onedrive_access
mdl_resource
mdl_resource_old
mdl_role
mdl_role_allow_assign
mdl_role_allow_override
mdl_role_allow_switch
mdl_role_allow_view
mdl_role_assignments
mdl_role_capabilities
mdl_role_context_levels
mdl_role_names
mdl_scale
mdl_scale_history
mdl_scorm
mdl_scorm_aicc_session
mdl_scorm_scoes
mdl_scorm_scoes_data
mdl_scorm_scoes_track
mdl_scorm_seq_mapinfo
mdl_scorm_seq_objective
mdl_scorm_seq_rolluprule
mdl_scorm_seq_rolluprulecond
mdl_scorm_seq_rulecond
mdl_scorm_seq_ruleconds
mdl_search_index_requests
mdl_search_simpledb_index
mdl_sessions
mdl_stats_daily
mdl_stats_monthly
mdl_stats_user_daily
mdl_stats_user_monthly
mdl_stats_user_weekly
mdl_stats_weekly
mdl_survey
mdl_survey_analysis
mdl_survey_answers
mdl_survey_questions
mdl_tag
mdl_tag_area
mdl_tag_coll
mdl_tag_correlation
mdl_tag_instance
mdl_task_adhoc
mdl_task_log
mdl_task_scheduled
mdl_tool_brickfield_areas
mdl_tool_brickfield_cache_acts
mdl_tool_brickfield_cache_check
mdl_tool_brickfield_checks
mdl_tool_brickfield_content
mdl_tool_brickfield_errors
mdl_tool_brickfield_process
mdl_tool_brickfield_results
mdl_tool_brickfield_schedule
mdl_tool_brickfield_summary
mdl_tool_cohortroles
mdl_tool_customlang
mdl_tool_customlang_components
mdl_tool_dataprivacy_category
mdl_tool_dataprivacy_ctxexpired
mdl_tool_dataprivacy_ctxinstance
mdl_tool_dataprivacy_ctxlevel
mdl_tool_dataprivacy_purpose
mdl_tool_dataprivacy_purposerole
mdl_tool_dataprivacy_request
mdl_tool_monitor_events
mdl_tool_monitor_history
mdl_tool_monitor_rules
mdl_tool_monitor_subscriptions
mdl_tool_policy
mdl_tool_policy_acceptances
mdl_tool_policy_versions
mdl_tool_recyclebin_category
mdl_tool_recyclebin_course
mdl_tool_usertours_steps
mdl_tool_usertours_tours
mdl_upgrade_log
mdl_url
mdl_user
mdl_user_devices
mdl_user_enrolments
mdl_user_info_category
mdl_user_info_data
mdl_user_info_field
mdl_user_lastaccess
mdl_user_password_history
mdl_user_password_resets
mdl_user_preferences
mdl_user_private_key
mdl_wiki
mdl_wiki_links
mdl_wiki_locks
mdl_wiki_pages
mdl_wiki_subwikis
mdl_wiki_synonyms
mdl_wiki_versions
mdl_workshop
mdl_workshop_aggregations
mdl_workshop_assessments
mdl_workshop_grades
mdl_workshop_submissions
mdl_workshopallocation_scheduled
mdl_workshopeval_best_settings
mdl_workshopform_accumulative
mdl_workshopform_comments
mdl_workshopform_numerrors
mdl_workshopform_numerrors_map
mdl_workshopform_rubric
mdl_workshopform_rubric_config
mdl_workshopform_rubric_levels
474 tables.
You could get yours via command line:
mysql -u $mddbuser -p$mddbpass -e "use $mddbname;show tables;" > m311tables.txt;cat m311tables.txt;
wc -l m311tables.txt
'SoS', Ken
Prior to any upgrade attempt, was environment check done from moodle admin? If so, did it report anything about DB not being fully compliant?
Reason asked: in the PDF collation of those tables shows utf8_general_ci. Thought 4 should be utf8mb4_unicode_ci and the character set should be utf8mb4.
Should be able to change both character set and collation via PHPMyAdmin ... or there is a script in code/admin/cli/ that runs php-cli only that would loop through all tables and all columns in tables and set them correctly for a version 4 of moodle.
mysql_collation.php
The other thing I think I'd try is to backup just one course via command line and save that backup to a directory outside of moodledata/filedir/
same directory as above, backup.php.
IF that works, think I'd backup every course that way ... even if there are many courses. You can skip course id 1 as that is front page ... can't restore that anyway.
A script like:
mysql -u root -p'[PASSWORD]' -e "use moodle;select id,category,fullname,shortname from mdl_course;" > courses.txt;cat courses.txt;wc -l courses.txt
Would give info on how many courses in courses.txt file.
If worse comes to worse, one could install a fresh 4.1.highest and then restore all those course backups.
'SoS', Ken
In an upgraded to 4.0.6+ (Build: 20230126) DB:
mysql> show tables like '%adminpresets%';
+-------------------------------------+
| Tables_in_moodle40 (%adminpresets%) |
+-------------------------------------+
| mdl_adminpresets |
| mdl_adminpresets_app |
| mdl_adminpresets_app_it |
| mdl_adminpresets_app_it_a |
| mdl_adminpresets_app_plug |
| mdl_adminpresets_it |
| mdl_adminpresets_it_a |
| mdl_adminpresets_plug |
+-------------------------------------+
8 rows in set (0.00 sec)
In a 4.1.1+ (Build: 20230210)
mysql> show tables like '%adminpresets%';
+--------------------------------------+
| Tables_in_moodle411 (%adminpresets%) |
+--------------------------------------+
| mdl_adminpresets |
| mdl_adminpresets_app |
| mdl_adminpresets_app_it |
| mdl_adminpresets_app_it_a |
| mdl_adminpresets_app_plug |
| mdl_adminpresets_it |
| mdl_adminpresets_it_a |
| mdl_adminpresets_plug |
+--------------------------------------+
8 rows in set (0.00 sec)
3.11.12+ (Build: 20230120)
mysql> show tables like '%adminpresets%';
Empty set (0.00 sec)
To revert back to version where you began (before upgrade attempt), one has to restore the backup sql to a new DB. And the code directory that was also part of that backup also has to be restored. In config.php of the restored code directory, one would also need to change DB name.
The debug screen however is showing something about question bank.
'SoS', Ken
Those tables you show in the PDF do belong in a 4.1.1. You can tell by their names - all presets.
In admin/settings.php?section=sitepolicies of a 4.1.1 highest:
But ... am confused ... the debug error shown is related to question bank ... cannot be added ... so sounds like something is already present there.
Mabye we are going down a 'rabbit hole' with presets concern and it's really an issue with question bank entries - the table * below:
| Tables_in_moodle311 (%question%) |
+----------------------------------+
| mdl_qtype_match_subquestions |
*| mdl_question |
| mdl_question_answers |
| mdl_question_attempt_step_data |
| mdl_question_attempt_steps |
| mdl_question_attempts |
| mdl_question_calculated |
| mdl_question_calculated_options |
| mdl_question_categories |
| mdl_question_dataset_definitions |
| mdl_question_dataset_items |
| mdl_question_datasets |
| mdl_question_ddwtos |
| mdl_question_gapselect |
| mdl_question_hints |
| mdl_question_multianswer |
| mdl_question_numerical |
| mdl_question_numerical_options |
| mdl_question_numerical_units |
| mdl_question_response_analysis |
| mdl_question_response_count |
| mdl_question_statistics |
| mdl_question_truefalse |
| mdl_question_usages |
mysql> explain mdl_question;
shows a couple of columns ...
| id | bigint(10) | NO | PRI | NULL | auto_increment
| idnumber | varchar(100) | YES | | NULL | |
Debug does show 'skipped' so maybe a bullet was dodged!!!?
Does that mean your site upgrade completely failed ... site is down ... cannot be accessed/logged on to?
Yes, know one would not like yo-yo-ing back and forth between versions especially if students have been in and done work that's been recorded in the DB ... students/teachers are losing work done then.
But trying to figure out what's really broke (DB wise) and then how to fix it ... in this situation ... is beyond me ... and probably all but true DB guru's!
'SoS', Ken
That's good to hear! So the issue are those tables ... which can exist in the DB and won't be used for anything since is no code that would make calls (reads/writes) to them. IF that's true, could drop the tables.
Run the environment check to see if there is any notification concerning DB character set/collation and fix that now. That would also show if one needed to add a php extension or upgrade php.
So this is a Windows platform?
Too bad .... as git on Linux sure makes core updates/upgrades a lot more reliable - and easier (less prone to human error).
Since you've had this 'scare' then ... remove all sql dump backups as they contain those un-needed tables and do a fresh dump. Ditto for old code backups. When one does a sql dump always do a code archive also ... those 2 go together.
Think I'd still backup courses via command line and archive those outside of moodledata.
And ... clone the site to another instance to test upgrades. 1st step to get the 3.11.5+ to the highest 3.11.x. Check. Working as expected, make full site backup and then upgrade to highest 4.0.x. Check. Working? Backup. Then the final 4.0.x to 4.1.x.
That sounds painful ... and it is doing things the old way ... again, better with Git.
'SoS', Ken
On the download page if you noticed the zip is larger than the tgz.
I experimented today ... downloaded both .. uncompressed both ... compared via diff to see if there was any difference in them other than size and compression. Didn't see any.
For you, with Wndows platform, you would gravitate to the .zip as zip has been a compression for that platform for as long as I can remember.
So another question ... when you begin your process of updating or upgrading, do you connect to the GUI desktop of the server and use the browser on the server to acquire the moodle zip. And unzip via whatever you have in Windows to accomplish that?
OR do you download the zip to your local machine, unzip it, then FTP the resulting moodle directory to your Windows server?
Then begin the documented process for updating or upgrading moodle code.
Interesting fact? Moodle course backups have a .mbz extension. That used to stand for 'moodle backup zip' ... now it's really 'moodle backup gunzip' - a tar gz.
The process of updating within a series must be too painful for most folks cause we see sooooo many having to upgrade to several versions higher than what they are running. Catch 22's there - as you might be experiencing now.
Have you ever investigated using Git for moodle code? Maybe not ... cause git has been non-native to Windows for a long time. However, in recent years M$ has purchased/owns the github ... so it might be easier now. Do know the git method of updating is pretty simple and makes it easier to keep moodle core code up-to-date. Fewer moving parts - less prone to human error.
My 2 cents!
'SoS', Ken
Am confused then as original posting says:
"OS: Windows 11 Pro
I'm getting a new error message, "Unknow DDL library error,"
That ain't Linux!!!!
Well, your description of steps looks ok.
SiteGround - from what I understand, the newer offerings, now run on Google infrastructure and rather then typical panels (like cPanel or Plesk or other), they have built their own. Thus, you probably don't have a 'Terminal' icon and might not be able to use an ssh client (like Putty) to login to your server.
The following might be old info and may not apply to their new hosting setups:
https://www.siteground.com/tutorials/ssh/
Does your panel show a 'Git' icon? That's for running your own repo of code which, when it comes to your use of moodle, isn't required (nor desired) as all you want to do is use it to keep your core code up-to-date and/or upgrade from time to time.
However ... there is this:
https://www.siteground.com/tutorials/getting-started/sg-git/
(moodle isn't listed)
Official Moodle docs:
https://docs.moodle.org/401/en/Git_for_Administrators
If you check my profile, there's a link to a moodle site and info there is about command line and moodle including git and bash shell scripts.
'SoS', Ken
Huh? That's your store for selling courses/articles etc.
WordPress and EcommerceThemes.org
So you have your 'store' inside a moodle.
When updating moodle you have to leave the 'store' directory
at the document root of your web site. And all the rest of the folders/files need to be moved to 'something.old' directory. Then the zip has to be unzipped at document root to begin the process of updating/upgrading moodle.
Could you have your store at another subdomain ... like:
store.rt-ce.com - which would be in a directory away from your moodle code?
Git by itself won't help the *minimal* approach you need. Need ssh/Terminal as well.
BTW, did confirm that your server is on Google Infrastructure ... IP address of the FQDN you have shared here in a whois look up shows:
NetName: GOOGLE-CLOUD
You might contact tech support at SiteGround to see if you can get a Terminal icon installed - if they make such a plugin for their panel.
Also ... found 11 domains on that same IP address. All appear to be related to same industry.
'SoS', Ken