Quantcast
Channel: General developer forum
Viewing all articles
Browse latest Browse all 37675

convert a 1.9 moodledata into a 2.2 moodledata

$
0
0
by Martin Henits.  

Dear all,

My Moodle 2.2's moodledata directory has got deleted by some mistake. I had made a backup of my moodledata directory before upgrading my Moodle from 1.9 to 2.2 and that's the only backup I do have.

unfortunately there is no backup of the database before the upgrade... so I can not re-upgrade my Moodle to convert the 1.9's moodledata directory into 2.2's.

Is there anyway that I can convert my 1.9's moodledata directory to a 2.2's moodledata directory? Does the following code work for this?

$rs = $DB->get_recordset('course');
foreach ($rs as $course) {
upgrade_set_timeout(60*5); // set up timeout, may also abort execution
$context = get_context_instance(CONTEXT_COURSE, $course->id);
upgrade_migrate_files_course($context, '/', true);
}
$rs->close();

Viewing all articles
Browse latest Browse all 37675

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>