I accidentally managed to make my moodle installation crash; I received a 503 error and the notification 'No top level course found'. The only way to repair it was to change a record in the database. It appeared to be a bug, so here's what I did:
Logged in as admin I went to Site administration > plugins > plugin overview > click the gear next to Activity modules > click the '1' in the Activities column on the row Forum > Search results shows the site name and description > click button Manage courses > Select the box in front of site name > Move selected courses to... and click a course category. And then it gives the error mentioned above.
(probably a fast way to get there is going to /course/search.php?modulelist=forum).
How to fix it is to change the course category id of the site name record in the database back to 0.
Background info: we don't use the forum function and I wanted to disable forum but I didn't find an option to do this, I ended up 'breaking' the website instead.