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

Re: Restoring backup into course should not delete previous backups

$
0
0
by Ken Task.  

If one acts soon, one might be able to recover a backup of the course.

While I'm showing command line, you will have to translate that to whatever tools you have ... phpmyadmin for queries ... cpanel or other file browser for files:

To see .mbz files in meta data of database, query the mdl_files table:

select filename,component,contenthash from mdl_files where filename like '%.mbz';



that should list/show something like:

+--------------------------------------------------------+--------------+------------------------------------------+
| filename                                               | component    | contenthash                              |
+--------------------------------------------------------+--------------+------------------------------------------+
| backup-moodle2-course-3-mdlcli-20200623-0912-nu.mbz    | mod_resource | 4179aac1c0863c9b27130569c886664ae93c33d6 |
| backup-moodle2-course-3-mdlcli-20200623-0912-nu.mbz    | mod_resource | 4179aac1c0863c9b27130569c886664ae93c33d6 |
| backup-moodle2-course-3-mdlcli-20200920-1606-nu.mbz    | user         | 691dc986b6142c776f4ee296dce7135e3c5aaee1 |
| backup-moodle2-course-136-mdlsampler-20190910-0027.mbz | mod_resource | 7076296142de12818f4b55e692dbb8a32452b319 |
| backup-moodle2-course-3-mdlcli-20201118-0854-nu.mbz    | user         | bc4e20b32f6ed86d0eec14fdaeb0b60a0432d778 |

The contenthash column info is the location of the file in moodledata/filedir/
Using the last one listed above as an example, your course backup was called backup-moodle2-course-3-mdlcli-20201118-0854-nu.mbz
the contenthash for that file is bc4e20b32f6ed86d0eec14fdaeb0b60a0432d778

From command line or from file. browser like in cPanel:

cd /path/to/moodledata/filedir/ (see config.php file of moodle for location of moodledata directory)

cd bc/4e

ls -l bc4e20b32f6ed86d0eec14fdaeb0b60a0432d778 (list file and shows size of file)

IF command: file -b bc4e20b32f6ed86d0eec14fdaeb0b60a0432d778

shows

gzip compressed data, from Unix

It is a moodle backup.   cPanel might have some button for mimetype.

**Copy** it out to some location outside of moodledata/filedir and name it the same as the filename as seen in the DB query:
cp bc4e20b32f6ed86d0eec14fdaeb0b60a0432d778 /home/myaccount/backup-moodle2-course-3-mdlcli-20201118-0854-nu.mbz

where /home/myaccount/ is a directory you can see in file browser and from which you can download.

Download backup.

Then restore via Moodle admin interface.

Good luck!

'SoS', Ken



Viewing all articles
Browse latest Browse all 6815

Trending Articles



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