How to restore the courses NON-orphaned.

How to restore the courses NON-orphaned.

by Marc Poirier -
Number of replies: 4
Hello.. for some reason beyond my understanding.. the courses have all disappeared ... I have kept the backups in the backups area for about a year... 

I tried to restore a course, I see all the files, but when it successfully restores the course, I get an orphan tab, all the files are there, but "hidden" from users!! 

How do I get them from orphan to "normal" state..

I had a ton of courses to do like that, so I'm not sure if I can batch restore?

i'm on 3.10 ... (can't upgrade since some plugins are not ready for higher versions)

thx.

Marc.

Average of ratings: -
In reply to Marc Poirier

Re: How to restore the courses NON-orphaned.

by Ken Task -
Picture of Particularly helpful Moodlers
Is this an extension of

to be honest, 3.10.x has already left my memory ... as to details and issues it had.

I don't believe I have ever heard of 'orphaned' backups so don't know what to suggest.

There is a plugin called '
is that what you are looking at?   That's compat up to version 2.9 of moodle.

There is also another plugin called 'all backups'
which does have a compat version for 3.10.

All disappearing sounds like, for some reason, they are in recyclebin - which is a la-la-land
note the link above goes to a version 4.1 of Moodle.

Here's the hidden kinda hard to find version for your 3.10

Really don't have an answer for how to recover that which I don't know exist! Sorry 'bout that!

'SoS', Ken
In reply to Ken Task

Re: How to restore the courses NON-orphaned.

by Marc Poirier -
Hi Ken.. I'll check those plugins.. every posts about orphan is about files in the trash or people wanted to clean them.. On my end.. the whole restore goes well, no issues.. i see the files once the backup is restored, so I don't believe they are in the trash.. if so.. then why did they end up there..

A lot of things don't make sense on that issue, that started with my other post about Plesk wanted to do an automated update of moodle to 3.11, without going through the DB update process with the plugins and all..

I'll definitely give those plugins a shot.. right now, I'm restoring the moodle site from my server backup, so hopefully this will the the fix...

the clients has over 1000 courses on the platform.. going back to them and saying .. "courses are gone oooops.." is like not an option lol!!! ;)

will update my findings...

cheers!
In reply to Marc Poirier

Re: How to restore the courses NON-orphaned.

by Ken Task -
Picture of Particularly helpful Moodlers
Am confused about description of what is going on ...

From my experience, once a file is in trashdir they are not recoverable.
mdl_files table has changed the linking of those files and associations to modules/courses is basically gone.   One can manually remove all in moodledata/trashdir/ without any issues or ill affects to the site as long as site is functioning and there are no errant links to files or modules that used or used to use the files in trashdir.

'orphaned' files - I've seen reference to them and there is a moosh command (cli only) to see orphaned files - which I think it defines as there is a reference in mdl_files table but no file in moodledata/filedir or vice-versa there is file in moodledata/filedir (not humanly recognizable BTW) for which there is no reference in mdl_files table of the DB.   In any case, not good!

Restoring site - if that site backup was weeks ago, if the restore is successful your 'client' will loose any thing that was done from the date of the backup to the present.
A site restore is code (back to a version lower than your current version I would assume), an SQL imported into a new DB (config.php file changed to point to the newly restored DB) and at least moodledata/filedir of the backup of moodledata ... whose content should match up to mdl_files/content hash column and other meta data in mdl_files table.

The issue of failed upgrade or stuck upgrade that never completed, if that messed with moodledata/filedir/ could no longer match meta data in mdl_files table.

Restore doesn't write over what exist there now ... but totally replaces what is there.

Anyhooo ... good luck!
'SoS', Ken