We’re still using v2.9, getting ready for a transition soon. I just did the unthinkable, deleting an instructor’s course without making a backup (I thought I had). Our trash directory is never backed up, so there’s no way to restore from there, but we do have regular site backups.
I have found the instructions on how to restore a site backup (beyond my technical scope, but I think our server admin can help). Before we attempt that, though, a couple of questions:
- Is there a way to identify a deleted course (and content) in the site backup? And if so, can that be extracted and restored by itself?
- Also, we would be restoring 2.9 to our test site, which is currently running 3.4.1. Is this doable?
Been awhile since I had a version you are running, but think that even back then, when a course was deleted, it was gone ... there are parts/pieces of it spread over moodledata/trashdir but one would have to be a guru of guru's to put it back together from there (tale of 'Humpty Dumpty'!).
A site backup restore (full ... code + DB + moodledata) directory would have that course in there but it would be accurate only up to the date of the site backup. Might be loosing a lot ... or, hopefully, not much.
Cannot 'extract' a course from the raw tar.gz file of code .... cannot extract one course from the DB sql file ... cannot re-cognize files in that backups moodledata/filedir without the meta data about that course in the backup.
To get the one course think you will have to restore the site backup you have.
However, one possible ... did teacher make a backup themselves? A course backup might be in teachers private files. You'll have to login as that teacher and then go to private files to see if they did.
You also might run a MySQL query on mdl_files for all files that end with .mbz ... those are backups. Backup file names might have course ID number in it. That query will show a contenthash column ... which is the location of the file in the sea of files in moodledata/filedir/ If there is one there, one could copy that file out of moodledata/filedir/xx/yy/someontenthashname to another location and rename it ... courseid###.mbz.
Could restore that courseid##.mbz file.
Some command line foo required to do some of the above.
'spirit of sharing', Ken
Yes, we've gotten a bit behind with our updates, to put it mildly.
Thanks so much for this extremely helpful information - you've saved us a great deal of time by ruling out what isn't possible. Our last backup of the course was a year ago, and is missing a significant portion of the content
We'll try restoring the latest site backup to test - keeping my fingers crossed!
Again, thank you for the help!
Welcome. Get to 3.3.8+ if you can ... has recyclebin for activities in courses, full courses, and categories of courses + the courses in that category deleted ... which means one can recover them all ... with a little work.
'spirit of sharing', Ken