HELP!! Tried to add course category and lost all courses

HELP!! Tried to add course category and lost all courses

by Laurie Stevens -
Number of replies: 7

 All,

I'm not sure how but I've somehow (seemingly) erased all the courses I'd posted (and I have yet to learn to backup my site - so, I'm a bit panicked - to say the least). I tried to add a new category of classes and got a red message saying the category couldn't be added. I realized I had to add some new members, went and did that and came back to the main area where my classes had been listed down the center and they were gone!!! Now, in the area where my courses were listed is a repeat of the right hand, introductory text block.

It seems the issue is that the only course category that existed (was MELODY) was somehow deleted when I went from the "add category" screen in courses, to the "add users" area. Because now I get this message when I go to courses:

Serious error: could not create default category.

Also, no one with administrator rights can go in and re-establish the category. So, no category, no classes.

I don't seem to be able to do anything with courses since this happened.

Oddly, a friend just went in and, did a search under the instructors name: Rick Carnes (at www.songwritersguild.com - click on chat or on forums). He found the missing courses under the instructors name and was able to subscribe to them. So, maybe they're not gone...but I can't see them as admin. And I still get the serious error message when I go to courses.

I know I am still in the process of learning Moodle but, this is mindboggling .

Can anyone help me? I have no idea how this happened. Is there any chance this is a glitch? Or will I truly have to repost each course?

Laurie Stevens

Average of ratings: -
In reply to Laurie Stevens

Re: HELP!! Tried to add course category and lost all courses

by Tom Murdock -
Hi Laurie,

I know you are nervous. I understand.

I'm not seeing the other courses either, but that doesn't mean they aren't in the database. I'd recommend NOT CHANGING or ADDING stuff, until you get a chance for a Moodler to look at your database.

Much of the stuff in Moodle still exists, even if a pointer is not pointing at it. If you know phpmyadmin, take a look at the course_category field. You'll want to create a new course_category (for the one that you erased). Note its ID #.

Then, you'll want to go to the course field and make sure that your courses point to the course_category ID #.

If you are nervous about changing stuff in phpmyadmin, I'd recommend simply looking in it and seeing whether the course field still has missing courses.

Let us know!

-Tom
In reply to Tom Murdock

Re: HELP!! Tried to add course category and lost all courses

by Art Lader -
Martin is online now. He'll know what to do. smile

-- Art
In reply to Tom Murdock

Re: HELP!! Tried to add course category and lost all courses

by Laurie Stevens -

Hi Tom,

Thanks for the feedback. I looked at a PHP file under 'courses' and 'categories.' A "find" search located well over 50 mentions of the word. In particular I think the "categories: name" entries apply. But there's no way I'm taking the chance on overwriting a file with my level of understanding. Maybe after a little more feedback.

Thanks again.

Laurie

In reply to Laurie Stevens

Re: HELP!! Tried to add course category and lost all courses

by Tom Murdock -
No, Jan Dierckx is right, you don't want to touch the Moodle code. I don't think anything is wrong with it. The database needs the urging.

Phpmyadmin is a php application that lets a person exam the Moodle database. If you download the module here (http://moodle.org/download/modules/#addons) and follow the instructions, you'll be able to look at your database.

I'm relieved that Jan was able to see those other courses using the id URL tags. This means that if someone DOES look in the Moodle database, he/she will be able to add a course_category tag to the referring field in the course.

You might email someone here at moodle.org if you want someone to take a look.

best,
Tom
In reply to Laurie Stevens

Re: HELP!! Tried to add course category and lost all courses

by Art Lader -
Anything to report on this, Laurie?

-- Art
In reply to Art Lader

Re: HELP!! Tried to add course category and lost all courses

by Laurie Stevens -

Art!

Yes, thank you. I'm happy to say the problem is fixed. However, I'm a little frightened at how it all happened.

I wanted to add a course category for a separate instructor last night. So I went into the proper area, click on 'add category' and saved changes. But nothing happened. Did I stop there? No, I couldn't leave well enough alone. I tried, twice more (perhaps three times) to force the program to accept a new category. I finally got a red message saying the category could not be added. I grew frustated and went and added three new students. When I returned to the area where the classes had been listed, they were suddenly gone. Then, as I tried to fix my problem, I got the "serious error" message. Talk about panicked!

I found out from my nephew (who, luckily for me, had a few minuts to devote to looking at MySQL database) that in carrying out the steps I did, I erased an entire table in my database. It never occurred to me that I could damage the database from the front end. I know Martin has some areas that give a warning about making changes, but this wasn't one of them. I found this land mine all on my own and corrupted my database. Apparently there was a fix that allowed my nephew to recreate the table. Then I just had to go in and recreate the category, reassign the classes to it....no big thing at that point. It's up and running again.

Now on to my next fire - cookies.

Thanks so much for your help and support.

Laurie

In reply to Laurie Stevens

Re: HELP!! Tried to add course category and lost all courses

by Art Lader -
Laurie,

That's great. smile

I am really glad that it worked out so well. Moodle on!

-- Art