Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: Ubuntu Debian Upgrades.

Ubuntu Debian Upgrades

From MoodleDocs
Revision as of 23:43, 22 March 2010 by Paul Perspectoff (talk | contribs) (New page: = Upgrading Moodle in Ubuntu / Kubuntu / Debian = *See [https://docs.moodle.org/en/Upgrading this Moodle Upgrade instruction page] for introductory details. *Copy the Moodle software dire...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Upgrading Moodle in Ubuntu / Kubuntu / Debian

  • Copy the Moodle software directory as a backup:
sudo cp -r /usr/share/moodle /usr/share/moodle_bak
  • Copy the Moodle data directory as a backup:
sudo cp -r /var/lib/moodle /var/lib/moodle_bak
  • Copy the local Moodle configuration directory as a backup:
sudo cp -r /etc/moodle /etc/moodle_bak
  • Dump your MySQL database content:
mysqldump -u username -p -C -Q -e --create-options moodle > moodle-backup-2010-04-01.sql

where username is the database MySQL user account name used to create the Moodle database during Moodle installation. The corresponding Moodle database password will be requested. (If you have forgotten these, they are recorded in the /etc/moodle/config.php file as $CFG->$dbuser and $CFG->$dbpass).

  • Download and unzip the current Moodle package:
sudo wget http://download.moodle.org/download.php/direct/stable19/moodle-weekly-19.zip
sudo unzip moodle-weekly-19.zip
sudo rm moodle-weekly-19.zip
  • Copy the new, extracted /moodle folder contents into the original /usr/share/moodle folder, overwriting the files there.
yes | sudo cp -r moodle/* /usr/share/moodle

Note: This method ensures that any files you have previously added, but for which no updates are available, remain in the /usr/share/moodle folder.

  • Make sure there is a symbolic link from your original config.php file in /etc/moodle to /usr/share/moodle. If not, create one:
sudo ln -s /etc/moodle/config.php /usr/share/moodle
  • There is a minor error in the version.php module numbering scheme from one version to the next. Edit the version.php file:
sudo nano /etc/moodle/version.php 
Change the line
$version = 2007101571.04;
to
$version = 2007101597.04;

Note: The new version number specified in $version must at least be greater than the $version number found in the version.php file located in the backup folder for the previous moodle installation (now presumably at /user/share/moodle_bak/version.php).

  • Login to your Moodle site (as an administrator) and load the new system:
Moodle -> Site Administration -> Notifications (Make sure to click on Notifications)


Other resources

This document was adapted from the originals at: