How to Backup www and moodledata directories

Поделиться
HTML-код
  • Опубликовано: 8 май 2022
  • To take a full Moodle backup there are three parts that need to be backed up:
    1) The Moodle code (www - least important)
    2) The moodledata directory (where all user data is stored - much more important)
    3) the SQL database (extremely important - covered in separate videos linked below ... soon).
    Do NOT leave home without a backup! You need backups! Do your thing to make the world a better place and backup your Moodle today!
    (Sorry, no commands in the description - angle brackets aren't allowed)

Комментарии • 17

  • @johnleggett5054
    @johnleggett5054 4 месяца назад +1

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

    • @Wise-Cat
      @Wise-Cat  3 месяца назад

      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!

  • @oki5503
    @oki5503 Год назад +1

    Great

  • @jairbarreto8988
    @jairbarreto8988 Год назад +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  Год назад

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

  • @Osaron14
    @Osaron14 4 месяца назад +1

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

    • @Wise-Cat
      @Wise-Cat  4 месяца назад

      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.

  • @AlexDelaforce
    @AlexDelaforce 11 месяцев назад +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  10 месяцев назад +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 10 месяцев назад +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 :)

  • @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  Год назад +2

      Sorry to take so long, but here it is: My guide on migrating a Moodle ruclips.net/video/k0nrYdFK9uA/видео.html
      Hope this helps!