Contorno da seção

  • How To Update Your Moodle4Mac

    • It's very simple to update your local installed Moodle. If you have got this course together with Moodle4Mac then you should have everything you need for a git update.

      The only software you must have installed on your Mac computer is the GIT tool. If you did so it only needs a doubleclick to get the newest Moodle without downloading the complete installation package anymore.

      Table of Contents

      • Part 1: Update the local Moodle via GIT
      • Part 2: Look inside ....
      • Part 3: Install the GIT tool on your Mac
    • Be sure that the git tool is installed on your Mac computer (see part 3). You also must have an internet connection to get the files from the update server.

      Now the only thing you need to do is to doubleclick on an icon inside your MAMP folder. That's all .... really .... it's easy!!

      Please look for the script UpdateMoodle.sh. If you doubleclick this icon then the system utility Terminal opens and the update process starts automatically. You must allow to connect to the Moodle internet server ... but think about this fact only if a system tool asks you.

      The git tool connects to the Moodle internet server and looks for all those files that must be downloaded. In its first run the update script needs to download the complete Moodle package in a special git format. In all next runs the update script will only load the changes. The update needs a few moments to find all updated or new files but then only those files are transfered. Please wait for some seconds until it's done.

      The files are downloaded into a temporary folder. You can see the process in the terminal window.

      If the update takes too long you may break with <strg>-C. It doesn't matter because only text files are copied. On break the process stops working. If you restart the update the git tool will find those files that need to be renewed again.

    • If you want to see what is done inside the script UpdateMoodle.sh please feel free to open it with a text editor. It is only a text file but it uses the macOS feature to open a file with a chosen program via doubleclick.

      We setup the system utility Terminal to open the file UpdateMoodle.sh and to run the contained script automatically. So everything can be done with a doubleclick. It's easy and everybody can do it!!

      #! /bin/sh
      #
      #  This GIT installer for macOS is part 
      #  of the installation package Moodle4Mac
      # 
      #  20240420 - Ralf Krause
      #
      
      echo
      echo "+--------------------------------------------+"
      echo "| GIT updater for your local Moodle server"
      echo "+--------------------------------------------+"
      echo
      
      cd /Applications/MAMP/htdocs
      
      if ! test -e moodle404/.git ; then
          ## the first git update must get everything including .git
          git clone --depth 1 -b MOODLE_404_STABLE https://github.com/moodle/moodle.git moodle404-git
          if test -e moodle404-git ; then
              if test -e moodle404 ; then
                  if test -e moodle404/config.php ; then
                      cp moodle404/config.php moodle404-git/.
                  fi
                  DATE=`date +%Y%m%d-%H%M`
                  mv moodle404 moodle404-$DATE
              fi
              mv moodle404-git moodle404
          fi
          ## the old folder can be deleted now
          ## if you want to do this please remove '##' from the following line
          ## rm -R moodle404-*
      else
          ## the next git update only gets the new files
          cd moodle404
          git pull
          cd ..
      fi
      
    • The different versions of the update script differ only in two things ... first you need to choose the correct folder for the Moodle files and seconds you use the correct git tag for git clone. The shown script is for updating the version Moodle 4.4.

      • Moodle 4.1 uses MOODLE_401_STABLE
      • Moodle 4.2 uses MOODLE_402_STABLE
      • Moodle 4.3 uses MOODLE_403_STABLE
      • Moodle 4.4 uses MOODLE_404_STABLE
      • Moodle 4.5dev uses main
    • Download the git tool from http://git-scm.com/download/. It's free.

      Open the installer disk and doubleclick the git-xxx-mac.pkg. If your are interested you may read the git documentation on the homepage but you do not need.

      If the git program is installed on your Mac then the script UpdateMoodle.sh should work fine ...