Great video as usual. I will use it and will try to set up a cron job every 24h that sends an incremental backup to AWS S3. I think I am punching above my weight, but a funny challenge ahead!
Good stuff! Especially important for automated backups is to make sure you test they're actually doing what they're supposed to be doing. I remember one time seeing a project with automated backups of multiple Moodles, but each backup of each Moodle overwrote the previous backup. So the backup, in reality, was a backup of one Moodle when three were supposed to be backed up. That was not a happy day... Also check in from time to time to make sure the backups are continuing. Automation works better if you look over its shoulder from time to time... Cheers!
Hi, I've written a script that does the backup of moodledata and the sql database. As part of this I am writing a 'climaintenance.html' file. I am having permission problems with writing and modifying the html file. my user is 'bitnami' and my moodledata directory is owned by 'daemon:daemon' . Would you suggest putting bitnami in the daemon group? I'm not sure if this would cause security issues. Sorry if this is not enough information. My script backs up and copies the moodledata and mysql data to an AWS S3 bucket using aws cli commands, logs the whole process, deletes old backup files and emails success or fail of the process. Still a few untidy bits of code but happy to share if you would like. Thanks if you have the time 😊
Sounds awesome. Very important that the backup script alerts you if it fails for some reason, so that's awesome to see. Regarding the climaintenance.html file, this can be generated by Moodle by invoking admin/cli/maintenance.php with either --enable or --disable. This is probably better for scripts as it will also display the same maintenance mode message that is set through the webUI. As for bitnami, I should really take another look at it, I guess, however last time I saw it, I wasn't very happy with how it worked. That was several years ago though...
Thanks @@Wise-Cat - In the end I directly changed the owner:group for the file from within the creation script. Yes, I'm not sure if Bitnami will be the best solution long term but OK for where I am at the moment. Great tip re the maintenance.php command - I'll definitely incorporate this rather than my boggy file creation method. My script writes to a log file at each step including deleting older tar and sql files, sending the files to an S3 bucket and I also use msmtp to send me an email giving either a pass or fail on the process. I'm 99% ready to use on production but still testing on a staging moodle while I learn. Cheers again - stay well :)
Yes, the theme code will be included in the Moodle code. Though the theme settings are saved to the SQL database, so you'll need to back that up as well.
hey bro my moodle broke for no apparent reason, Error Exception - DirectoryIterator::__construct([dirroot]/cache/stores): failed to open dir: No such file or directory Do you have any idea what could have happened?
Not much of an idea, though from the message it looks like Moodle was looking for a file that wasn't found. Check the moodledata dir location in config.php or purge caches perhaps...
That's a great topic for a video: Moodle Migrations. Where the moodledata dir just needs to be copied (making sure the permissions remain OK) the SQL needs to be "dumped" and then imported to the new server. Yes that does sound like it would make a good video.
Thanks so much for all your excellent videos. I am watching so many and learning so much!
Glad you like them!
Great video as usual. I will use it and will try to set up a cron job every 24h that sends an incremental backup to AWS S3. I think I am punching above my weight, but a funny challenge ahead!
Good stuff! Especially important for automated backups is to make sure you test they're actually doing what they're supposed to be doing. I remember one time seeing a project with automated backups of multiple Moodles, but each backup of each Moodle overwrote the previous backup. So the backup, in reality, was a backup of one Moodle when three were supposed to be backed up. That was not a happy day...
Also check in from time to time to make sure the backups are continuing. Automation works better if you look over its shoulder from time to time...
Cheers!
Hi, I've written a script that does the backup of moodledata and the sql database. As part of this I am writing a 'climaintenance.html' file. I am having permission problems with writing and modifying the html file. my user is 'bitnami' and my moodledata directory is owned by 'daemon:daemon' . Would you suggest putting bitnami in the daemon group? I'm not sure if this would cause security issues.
Sorry if this is not enough information.
My script backs up and copies the moodledata and mysql data to an AWS S3 bucket using aws cli commands, logs the whole process, deletes old backup files and emails success or fail of the process. Still a few untidy bits of code but happy to share if you would like.
Thanks if you have the time 😊
Sounds awesome. Very important that the backup script alerts you if it fails for some reason, so that's awesome to see. Regarding the climaintenance.html file, this can be generated by Moodle by invoking admin/cli/maintenance.php with either --enable or --disable. This is probably better for scripts as it will also display the same maintenance mode message that is set through the webUI.
As for bitnami, I should really take another look at it, I guess, however last time I saw it, I wasn't very happy with how it worked. That was several years ago though...
Thanks @@Wise-Cat - In the end I directly changed the owner:group for the file from within the creation script.
Yes, I'm not sure if Bitnami will be the best solution long term but OK for where I am at the moment.
Great tip re the maintenance.php command - I'll definitely incorporate this rather than my boggy file creation method.
My script writes to a log file at each step including deleting older tar and sql files, sending the files to an S3 bucket and I also use msmtp to send me an email giving either a pass or fail on the process. I'm 99% ready to use on production but still testing on a staging moodle while I learn. Cheers again - stay well :)
Does it saves the theme as well? or do I have to install the theme in rhe new machine?
Yes, the theme code will be included in the Moodle code. Though the theme settings are saved to the SQL database, so you'll need to back that up as well.
hey bro my moodle broke for no apparent reason,
Error
Exception - DirectoryIterator::__construct([dirroot]/cache/stores): failed to open dir: No such file or directory
Do you have any idea what could have happened?
Not much of an idea, though from the message it looks like Moodle was looking for a file that wasn't found. Check the moodledata dir location in config.php or purge caches perhaps...
How can I move moodledata and mysql database to a new site with a different url
That's a great topic for a video: Moodle Migrations.
Where the moodledata dir just needs to be copied (making sure the permissions remain OK) the SQL needs to be "dumped" and then imported to the new server. Yes that does sound like it would make a good video.
@@Wise-Cat Thank you, Kindly provide me with the video tutorial to guide me do so.
Sorry to take so long, but here it is: My guide on migrating a Moodle ua-cam.com/video/k0nrYdFK9uA/v-deo.html
Hope this helps!
Hi Adam, I am trying to reach you
Great
Thank you.