Edutizer Manuals  
Administrator's Handbook
Edutizer manuals | Administrator handbook | A2 Manage | Various database scripts | Undelete course books and lessons deleted by accidentally archiving a folder

Undelete course books and lessons deleted by accidentally archiving a folder

 Task: get back folder full of course books that got deleted when user accidentally archived a folder

DISCLAIMER: This script has been tested by MWX engineers. This script is provided without any warranty. Do back up you database before using this script.
Step 1. Get the topic_id of the archived folder.

SELECT topic_id FROM Topics WHERE  topic_name = '<topic_that_just_got_archived>';

Step 2.  Undelete course books and lessons

UPDATE Courses SET state = 1 WHERE course_id IN (SELECT course_id FROM Topics_Courses WHERE topic_id = <topic_id>);
UPDATE Lessons SET state = 1 WHERE course_id IN (SELECT course_id FROM Topics_Courses WHERE topic_id = <topic_id>);

Step 3. Set folder as passive, so it becomes visible again in teacher application.

UPDATE Topics SET state = 2 WHERE topic_id = <topic_id>;

Step 4. Recreate folder tree cache.

In teacher application, create a new root level topic.
Archive it. 
Search the handbook

More reading...

Latest articles
Answer not found here? Write us!
  EDUTIZER E-TRAINING ENVIRONMENT
A MINDWORKS PRODUCT

© MINDWORKS INDUSTRIES 2000-2010
powered by MAUI