How to Backup www and moodledata directories

Поділитися
Вставка
  • Опубліковано 3 гру 2024

КОМЕНТАРІ • 18

  • @johnleggett5054
    @johnleggett5054 8 місяців тому +1

    Thanks so much for all your excellent videos. I am watching so many and learning so much!

    • @Wise-Cat
      @Wise-Cat  8 місяців тому

      Glad you like them!

  • @antonioandresgarcia5130
    @antonioandresgarcia5130 2 роки тому +1

    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!

    • @Wise-Cat
      @Wise-Cat  2 роки тому +1

      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!

  • @AlexDelaforce
    @AlexDelaforce Рік тому +1

    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 😊

    • @Wise-Cat
      @Wise-Cat  Рік тому +1

      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...

    • @AlexDelaforce
      @AlexDelaforce Рік тому +1

      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 :)

  • @Osaron14
    @Osaron14 9 місяців тому +1

    Does it saves the theme as well? or do I have to install the theme in rhe new machine?

    • @Wise-Cat
      @Wise-Cat  9 місяців тому

      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.

  • @jairbarreto8988
    @jairbarreto8988 2 роки тому +1

    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?

    • @Wise-Cat
      @Wise-Cat  2 роки тому

      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...

  • @wekesamacdonald6202
    @wekesamacdonald6202 Рік тому +1

    How can I move moodledata and mysql database to a new site with a different url

    • @Wise-Cat
      @Wise-Cat  Рік тому

      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.

    • @wekesamacdonald6202
      @wekesamacdonald6202 Рік тому

      @@Wise-Cat Thank you, Kindly provide me with the video tutorial to guide me do so.

    • @Wise-Cat
      @Wise-Cat  Рік тому +3

      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!

  • @supersmart671
    @supersmart671 Місяць тому

    Hi Adam, I am trying to reach you

  • @oki5503
    @oki5503 2 роки тому +1

    Great