How to fix and upgrade moodle after messy update attempt