Looking for a quick and easy to backup the Moodle site so that we I can restore in case of a disaster. We have our whole server backup running using backup software. We want to add a second layer of back by using 'Automated backup setup' any idea how much of space it will take? don't want to run out of space.
Quick and easy to backup the Moodle site so that we can restore
Re: Quick and easy to backup the Moodle site so that we can restore
Nobody can answer that for you. It depends on how many courses you have and how big they are. It's also quite resource intensive.
Re: Quick and easy to backup the Moodle site so that we can restore

Re: Quick and easy to backup the Moodle site so that we can restore
Re: Quick and easy to backup the Moodle site so that we can restore
Yes - you can point the output wherever you like. The docs I pointed you to explain it.
Re: Quick and easy to backup the Moodle site so that we can restore
"... whole server backup running using backup software" ...
and you've tested that?
Actually, maybe a 2nd layer - just moodle stuff ... moodle code, moodledata/filedir/ and DB dump. You have 2 sites on same server so the following would need to be adjusted for each.
You have to create the backups directory and replace [] below.
As root user:
df -h
That will show how much is used and available.
Your code, db, and moodledata will be in /
You have 2 sites on same server.
So to get exact info
cd /path/to/whereyoucanlsonesite
then
du -h ./site
That's code.
Find paths to your moodledata directories. Check config.php file of each site.
Then same:
cd /path/to/whereyoucanlsthemoodledata
then
du -h moodledata/filedir/
DB - mysqldump command to a directory where you are saving the code and minimal moodledata/filedir/
mysqldump --default-character-set=utf8mb4 -u root -p'[password]' [dbname] > [/path/to/]backups/moodle-[moodlevrnumber]-$(date +%Y%m%d%-H%M).sql;
You replace [] above and you create the /path/to/ directory for backups.
For code:
cd /path/to/whereyoucanseemoodlecode
tar -cvf [/path/to/]backups/moodle-[vrnum]-$(date +%Y%m%d%-H%M).tar
will render files something like:
moodle-4116-202502071915.sql
moodle-4116-202502071915.tar
Ditto for moodledata ...
cd /path/whereyoucanseemoodledata
then
tar -cvf /path/to/backups/moodle-data-[vrnum]-$(date +%Y%m%d%-H%M).tar
'SoS', Ken
Sent you a PM with a reminder.
Re: Quick and easy to backup the Moodle site so that we can restore
When I did df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 791M 1.1M 790M 1% /run
/dev/mapper/vg00-lv01 116G 77G 34G 70% /
tmpfs 3.9G 4.0K 3.9G 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/vda1 488M 364M 88M 81% /boot
tmpfs 791M 8.0K 791M 1% /run/user/0
root@localhost:/var/www/mywebsite#du -h
I get list of files and the size and at the end 365M ./moodle
8.5G
2.4G so combined it is taking 15.3 GB
Re: Quick and easy to backup the Moodle site so that we can restore
This line:
Size Used Avail Use%
/dev/mapper/vg00-lv01 116G 77G 34G 70% /
Your code and data directories are in /
Means you have 34G TOTAL free space.
Your code directories: 15.3 GB
You didn't, however, check size of each sites moodledata directory.
That's where will find a lot more usage of space. And, in anticipation of the next question regarding moodledata directories, there is generally no way to reduce their size ... they only grow so in the future, you will be using yet more space.
Right now, not looking good 15G from 34G avaiable leaves 18.7 G free space.
Where you host, do they offer attached data devices?
'SoS', Ken
Re: Quick and easy to backup the Moodle site so that we can restore
Quick and easy? It depends on your computer experience. Do you understand what is described in "Moodle Docs—Site Backup?" Everything you need to know is in the documents.