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

Re: recovery of accidentally deleted courses (v.2.2.6)

$
0
0
by Ken Task.  

Have a 2.2.6+ server for which I haven't run the cron job in a long time.  Thus, the trashdir in moodledata still contains courses/files to be removed.   So same process as mentioned before only in the 'trashdir'.

once again, the cron job that empties the trashier must not have run.

cd moodledata/trashdir/
if the directory exist

ls -lR
list directory long and recursive

Will show something like this:

[root@sos trashdir]# ls -l
total 8
drwxrwxrwx 3 root root 4096 Dec 21 09:58 8d
drwxrwxrwx 3 root root 4096 Dec 21 09:58 fa
[root@sos trashdir]# ls -lR
.:
total 8
drwxrwxrwx 3 root root 4096 Dec 21 09:58 8d
drwxrwxrwx 3 root root 4096 Dec 21 09:58 fa

./8d:
total 4
drwxrwxrwx 2 root root 4096 Dec 21 09:58 8f

./8d/8f:
total 27988
-rw-rw-rw- 1 root root 28625837 Oct  3 08:12 8d8fcf878bbfc553fa6ae3f6d4af748a878743cd

./fa:
total 4
drwxrwxrwx 2 root root 4096 Dec 21 09:58 4b

./fa/4b:
total 16
-rw-rw-rw- 1 root root 12748 Oct  3 08:12 fa4bbdc44a9b6a79ea513f9ea0833ae4441fa31d

Backups are more than likely larger than other files.  In this example, notice the  8d8fcf878bbfc553fa6ae3f6d4af748a878743cd file  in ./8d/8f/
is 28625837 in size.

It might be a backup that hasn't been removed.

cd moodledata/trashdir/8d/8f/

cp 8d8fcf878bbfc553fa6ae3f6d4af748a878743cd /home/test/

cd /home/test/

mv 8d8fcf878bbfc553fa6ae3f6d4af748a878743cd acoursebackup.zip

unzip acoursebackup.zip

Again, if you see files/folders like:

course     gradebook.xml      moodle_backup.xml  roles.xml   users.xml
activities         files      groups.xml         outcomes.xml       scales.xml
completion.xml     files.xml  moodle_backup.log  questions.xml      sections

It's a backup! ;)

To see the course name:

head -n 4 moodle_backup.xml

will show:

<?xml version="1.0" encoding="UTF-8"?>
<moodle_backup>
  <information>
    <name>backup-moodle2-course-testmobile-20121003-0812.mbz</name>

Again, best of luck!

'spirit of sharing', Ken


Viewing all articles
Browse latest Browse all 6543

Trending Articles



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