Thanks a lot! It was helpful.
I updated the following tables: mdl_files, mdl_resource, mdl_context, mdl_course_modules, mdl_course_sections
Then, I was able to rebuild the course caches by adding an extra plugin: https://moodle.org/plugins/pluginversion.php?id=2400