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

Re: Legacy course files deleted in backup

$
0
0

by Ken Task.  

In the DB, legacy is just 'label' (for lack of a better term) under the
'filearea' column.

They are 'files' and while the progress/info you see in deleting a course
reports files it won't display anything special for 'legacy'.

You can verify.   Deleting files also involves removing records from mdl_files table.

Here's a query to run on your DB:

select * from `mdl_files` where (`filearea` like "legacy" and `filename` like "%.zip%")

The backups for 1.9's were zips.  The query produces a column for contenthash
(that's how the files are really named in the file system).

Contenthash looks like:

f06dc2fea6e580f0447e3214548b4afd9ed51a27

From command line (you'd have to use whatever you have to browse files on your site):

cd /path/to/moodledata/filedir/
cd f0/6d/ (the first 4 characters are also subdirectories in filedir)
ls -l

should show a file named  by the contenthash.

To see if that is potentially a backup file (a zip) - caution - it could be a zip of files used in a folder.

file -b f06dc2fea6e580f0447e3214548b4afd9ed51a27

Should report it's a zip.

If the file has been deleted it's really moved to moodledata/trashdir/ first.
So you could search files in trashdir for the contenthash name to see if they
are out of filedir and will, eventually, be deleted upon the running of the cron/task.

Don't remove rows in the DB ... that's meta data.  Removing rows will NOT actually delete the file itself.  Let the moodle process do it's thing. ;)


'spirit of sharing', Ken


Viewing all articles
Browse latest Browse all 6619

Trending Articles



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