Backup Concepts Clarifications

Backup Concepts Clarifications

by S A -
Number of replies: 11

I have read the "Site backup" and "Automated course backup" from the docs but I am not clear on a few things.

Site backups - grabs everything needed? for a restore, but;
  1. Are these backups the only thing needed or do we still need to configure course backups?
  2. If course content is included, do they allow for granular restore of an individual course or is this a full restore of the entire server?
Automated course backup
  1. This is just an automated backup so teacher don't have to do their own manual backups?
I am trying to confirm if I should just be using our Backup Software agent and grab;
  1. an export of the DB, using a export script
  2. the folder(s), moodledata, entire wwwroot?
or if the auto backup gets everything I need?
Average of ratings: -
In reply to S A

Re: Backup Concepts Clarifications

by Séverin Terrier -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Hi,

The (automated) course backup makes a backup of a course, like a teacher could do. It allows to restore it in a Moodle site (the same, or another).

The site backup is a complete backup of the whole Moodle installation, needing DB, Moodle installation directory and Moodle files directory, allowing to restore a complete Moodle installation/server.

HTH,
Séverin
Average of ratings: Useful (1)
In reply to Séverin Terrier

Re: Backup Concepts Clarifications

by S A -
Thanks for the reply Séverin, so the Site Backup includes all courses as well, but can you confirm if the site backup can be used to restore a single course or is this an all or nothing scenario?

So for a complete backup solution I'll need a site backup for a disaster restore and course backups (automated or individually by content creator)?
In reply to S A

Re: Backup Concepts Clarifications

by Séverin Terrier -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Yes, the site backup allows you to (re)create a whole Moodle site. From it, you can extract what you want, from each course you want. But you'll have to restore the whole site to be able to do that !

If you want/need some more granular things, and want to avoid having to remake a whole Moodle site (which can be very huge), you'll have to make individual course backups.

HTH and is (more) clear,
Séverin
Average of ratings: Useful (2)
In reply to Séverin Terrier

Re: Backup Concepts Clarifications

by S A -
OK thanks, that makes sense.

I tested a manual backup of a single course, I can see the backups listed on the Restore section. Are these course backups saved in the Moodle DB or directly on the file system? I did a search for the file name and even *mbz from / and don't see these backups.

I also enabled Auto Backups, with "Automated backup storage" set to "Course backup filearea" and "Save to" empty. But it doesn't seem to be working or showing up in the course restore listing. Any thoughts to what I am doing wrong with auto backups?
I am assuming if I set "Save to" path this could be redirected to the file system or remote system?
In reply to S A

Re: Backup Concepts Clarifications

by S A -
After further reading I decided to set the "Save to" path to an alternate location, just waiting for the time of the next auto backup to run to see if it works. Its a local folder for now, for testing.

Still nothing and the journal is not showing any errors, am I looking in the wrong place for feedback?

Automated backup storage: Specified directly for auto backups
Save to Path: /var/www/moodleBackup
Permissions: drwxr-xr-x 2 www-data www-data 4096 May 18 11:51 moodleBackup

Journal
May 18 12:00:01 training CRON[36676]: pam_unix(cron:session): session opened for user www-data by (uid=0)
May 18 12:00:01 training CRON[36677]: (www-data) CMD (/usr/bin/php /var/www/moodle/admin/cli/cron.php  >/dev/null)
May 18 12:00:02 training CRON[36676]: pam_unix(cron:session): session closed for user www-data
In reply to S A

Re: Backup Concepts Clarifications

by S A -
I was looking at the "Last execution log" under /Reports/Backups/ and see all courses listed but with a pending status. Next backup is set to 10:10 May 25, probably due to my first settings when I only set Tue 10:10am.

I am wondering if the time changes I have been making to the Auto Backup settings are being updated or if the system will now wait until May 25 10:10 to attempt the next auto backup?
If so is there a way to reset this?

I was able to successfully run a CLI backup with;
sudo -u www-data /usr/bin/php /var/www/moodle/admin/cli/backup.php --courseid=7 --destination=/var/www/moodleBackup
but this is only an individual course backup and I am hoping to get the auto backups working asap.

Any suggestions would be appreciated.
In reply to S A

Re: Backup Concepts Clarifications

by Ken Task -
Picture of Particularly helpful Moodlers

Am gonna add 2 cents to this as in the past and with older versions of moodle that did not have adhoc task, I had to create an auto backup system of my own ... using the backup.php script which you have already used and know it will work.

My brief 'sad story'  concerning auto backups - HS Moodle - many course backups were large ... 1 in particular ... course was in digital media - everything/anything digital - photography, audio, video and then some.

Had auto back ups set to designated directory ... outside of moodledata/filedir/ ... when cron ran auto, it would never complete past that dig media course ... discovered that ... backed it up via command line ... it did complete!   at the time that backup was about 120+ GIG.

So ... turned of auto backup ... truncated any table related to auto ... did a query of database looking only for .mbz files and sorted by size of file.   That allowed me to determine which courses would be backed up via command line via bash shell script on Sunday .... all day Sunday!

Had 3 such scripts that looped through a smallcids.txt (cids=course id numbers only) file, a mediumcids.txt file, and a largecids.txt file (only 3 courses including that DM course) and used the admin/cli/backup.php script that pointed to a designated directory.

All that to say ... depending upon how large your courses are and if you can ever get auto to work as it should ... will be only to glad to share how I did above.

'SoS', Ken


In reply to Ken Task

Re: Backup Concepts Clarifications

by S A -
Sorry for slow response, had some bigger issues that needed attention.

Thanks Ken for the reply, so are you saying the auto backup system for Moodle doesn't work? This is a new server and I don't see us, at least at this point, having courses that large.
Having to manually keep track of what courses have been added and their ID seems problematic unless we don't allow staff to create courses on their own.

Besides the vague logs in the Moodle UI is there somewhere else I should be looking? Being a new server with only a 3.5MB DB the auto backup should work, unless it is completely broken.
In reply to S A

Re: Backup Concepts Clarifications

by Ken Task -
Picture of Particularly helpful Moodlers

No, didn't say it doesn't work ... usually does ... initially.   But with time and usage (only grows unless one 'cleans up') auto backup has 'gone south'  ... with factors like size of courses - db hickups - cron job issues - etc..

Here's hoping you never have issues with it ... but know, if you do, there are other ways.

Your journey has begun! smile

'SoS', Ken


In reply to S A

Re: Backup Concepts Clarifications

by S A -
So after waiting on the queue to run at the "next backup" time time the "Last execution log" is now showing a "OK" status.
And further testing, it appears changes to the Auto Backup page take effect only take effect when the next scheduled backup actually runs, at least the scheduled time settings.

I can now see 3 versions of each course in the "/var/www/moodleBackup/" folder. My settings are to keep only 3 (as a test) so my assumption the next backup will start the rotation.

I had expected to see the auto backups to be listed on the Restore page of the course in the "Automated backups" section but they are not. I can see the manual backups listed but no auto backups, is this normal?
In reply to S A

Re: Backup Concepts Clarifications

by Ken Task -
Picture of Particularly helpful Moodlers

If backups sent to a designated directory only, yes, that is normal.

You could setup a file system repo using a symlink from moodledata/repository/ to your '/var/www/moodleBackup/' to  see the directory and thus the backups.

If it's just you, system wide file system repo.   If other teachers and you don't want them to see those, then set up the file system repo in a course.

'SoS', Ken


Average of ratings: Useful (1)