Quantcast
Channel: Backup and restore
Viewing all articles
Browse latest Browse all 6815

Backup by Category ID Instead of by Course ID - with sub-categories

$
0
0
by Séverin TERRIER.  

Hi,

I'd say that this is a (good) solution to backup courses of a category (strictly).

But if you also want to backup all courses of all subcategories, you should adapt the initial select query to :
SELECT c.id, c.category, c.fullname
FROM mdl_course c
JOIN mdl_course_categories cc ON c.category = cc.id
WHERE cc.id = 43 OR cc.path LIKE '%/43/%';

If you use moosh, you could use the course-list command to obtain all course's id from a category and it's sub-categories with a simple command :
moosh course-list -i -c 43
 
Séverin

Viewing all articles
Browse latest Browse all 6815

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>