How to restore the Moodle frontpage forum

In versions of Moodle before 2.9 it’s not possible to use the Moodle interface to simply restore a backup of your front page course, or activities within it.

I’ve found a route around this problem which enabled me to restore my front page ‘site news’ forum. It involved a little database poking so find yourself a tame sysadmin if you’re not confident.

Make sure you backup before you start. Really.

1) Restore your forum backup. Use the usual moodle routine to restore a backup, creating a new course.
2) In the database, look for the mdl_forum table and find the ID of your site news forum, and the ID of the new forum you have just created.
3) Now, look at the mdl_forum_discussions table. Run a quick search for the IDs you found in step 2 and you’ll see posts to each of the forums. To move a discussion from your newly restored forum and add it to the front page site news forum, simply change the ID field.
4)A simple SQL query will move all discussions from the restored forum to the front page. Something like:

UPDATE `mdl_forum_discussions` SET `forum` =(frontpage forum id) WHERE `forum` = (your new forum id)

And, that’s it.

 

Leave a Reply

Your email address will not be published. Required fields are marked *