Missing Announcements or News Forum in MOODLE

In case a course has a missing announcements or news forum, here is the solution:

  1. Get the course id of the course you are viewing
  2. Goto mdl_forum in MySQL
  3. Find the news and announcement forums corresponding to the course id
  4. Delete those two forums

This will create two new forums and will create links to them in the course.