Note: You are currently viewing documentation for Moodle 2.5. Up-to-date documentation for the latest stable version of Moodle may be available here: Upgrading.

Upgrading: Difference between revisions

From MoodleDocs
Line 1: Line 1:
Moodle is designed to upgrade cleanly from any earlier version to any later version.
Moodle is designed to upgrade cleanly from any earlier version to any later version. Please refer to '''[[Upgrading to Moodle 1.6]]''' for particular considerations related to Moodle 1.6 features.


When upgrading a Moodle installation you should follow these steps:
When upgrading a Moodle installation you should follow these steps:
Line 9: Line 9:
There are three areas that need backing up:
There are three areas that need backing up:


=== The Moodle software directory itself ===
=== 1. The Moodle software directory itself ===


Make a separate copy of these files before the upgrade, so that you can retrieve your config.php and any modules you have added like themes, languages etc
Make a separate copy of these files before the upgrade, so that you can retrieve your config.php and any modules you have added like themes, languages etc


=== Your data directory ===
=== 2. Your data directory ===


This is where uploaded content resides (such as course resources and student assignments) so it is very important to have a backup of these files anyway. Sometimes upgrades may move or rename directories within your data directory.
This is where uploaded content resides (such as course resources and student assignments) so it is very important to have a backup of these files anyway. Sometimes upgrades may move or rename directories within your data directory.


=== Your database ===
=== 3. Your database ===


Most Moodle upgrades will alter the database tables, adding or changing fields. Each database has different ways to backup. One way of backing up a MySQL database is to 'dump' it to a single SQL file. The following example shows Unix commands to dump the database called "moodle":
Most Moodle upgrades will alter the database tables, adding or changing fields. Each database has different ways to backup. One way of backing up a MySQL database is to 'dump' it to a single SQL file. The following example shows Unix commands to dump the database called "moodle":
Line 46: Line 46:
First you need to do a CVS checkout in your (empty) Moodle root directory.
First you need to do a CVS checkout in your (empty) Moodle root directory.


''For Linux servers''
'''For Linux servers'''


To do a CVS checkout of Moodle, you first have to logon to the Moodle CVS server.
To do a CVS checkout of Moodle, you first have to logon to the Moodle CVS server.
Line 58: Line 58:
   co -r MOODLE_15_STABLE moodle</nowiki>  
   co -r MOODLE_15_STABLE moodle</nowiki>  
   (where MOODLE_15_STABLE is the desired version)
   (where MOODLE_15_STABLE is the desired version)


To update, just go into the Moodle root directory and update to the new files:
To update, just go into the Moodle root directory and update to the new files:
Line 66: Line 65:
Make sure you use the "d" parameter to create new directories if necessary, and the "P" parameter to prune empty directories.
Make sure you use the "d" parameter to create new directories if necessary, and the "P" parameter to prune empty directories.


''For Windows servers''
'''For Windows servers'''


You can use Tortoise CVS to do the initial checkout and the updates.
You can use Tortoise CVS to do the initial checkout and the updates.


If you have been editing Moodle files, watch the messages very closely for possible conflicts. All your customised themes and non-standard plugins will be untouched.
If you have been editing Moodle files, watch the messages very closely for possible conflicts. All your customised themes and non-standard plugins will be untouched.
Line 79: Line 77:
The last step is to trigger the upgrade processes within Moodle.
The last step is to trigger the upgrade processes within Moodle.


To do this just visit the admin page of your installation - '''<nowiki>http://example.com/moodle/admin</nowiki>'''
To do this just visit the admin page of your installation e.g. ''<nowiki>http://example.com/moodle/admin</nowiki>''


It doesn't matter if you are logged in as admin or not.
It doesn't matter if you are logged in as admin or not.
Line 86: Line 84:


Assuming all goes well (no error messages) then you can start using your new version of Moodle and enjoy the new features!
Assuming all goes well (no error messages) then you can start using your new version of Moodle and enjoy the new features!
If you have trouble with the upgrade, visit [http://moodle.org/ moodle.org] and post on the [http://moodle.org/mod/forum/view.php?id=28 Installation Support Forum] in the Using Moodle course.


==See also==
==See also==


 
*Using Moodle [http://moodle.org/mod/forum/view.php?id=28 Installation problems] forum
*[[Upgrading to Moodle 1.6]]
*[[Upgrading to Moodle 1.6]]
*[[Installing Moodle]]
*[[Installing Moodle]]
Line 99: Line 95:
*[[Step by Step Installation Guide for RedHat]]
*[[Step by Step Installation Guide for RedHat]]
*[[Step by Step Installation Guide for Debian GNU/Linux]]
*[[Step by Step Installation Guide for Debian GNU/Linux]]
*[http://moodle.org/mod/forum/discuss.php?d=26731&parent=125858 Using cvs] forum discussion
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=26731&parent=125858 Using cvs] forum discussion


[[Category:Core]]
[[Category:Core]]
[[Category:Administrator]]
[[Category:Administrator]]
[[Category:Installation]]
[[Category:Installation]]


[[es:Actualización de moodle]]
[[es:Actualización de moodle]]
[[fr:Mise à jour]]
[[fr:Mise à jour]]
[[nl:Upgraden]]
[[nl:Upgraden]]

Revision as of 10:39, 27 June 2006

Moodle is designed to upgrade cleanly from any earlier version to any later version. Please refer to Upgrading to Moodle 1.6 for particular considerations related to Moodle 1.6 features.

When upgrading a Moodle installation you should follow these steps:

Backup important data

Although it is not strictly necessary, it is always a good idea to make a backup of any production system before a major upgrade, just in case you need to revert back to the older version for some reason. In fact, it's a good idea to automate your server to backup your Moodle installation daily, so that you can skip this step.

There are three areas that need backing up:

1. The Moodle software directory itself

Make a separate copy of these files before the upgrade, so that you can retrieve your config.php and any modules you have added like themes, languages etc

2. Your data directory

This is where uploaded content resides (such as course resources and student assignments) so it is very important to have a backup of these files anyway. Sometimes upgrades may move or rename directories within your data directory.

3. Your database

Most Moodle upgrades will alter the database tables, adding or changing fields. Each database has different ways to backup. One way of backing up a MySQL database is to 'dump' it to a single SQL file. The following example shows Unix commands to dump the database called "moodle":

mysqldump -u username -p -C -Q -e -a moodle > moodle-backup-2002-10-26.sql

Substitute your database user account for username. The -p flag will prompt you for the password for the username specified by -u.

You can also use the "Export" feature in Moodle's optional "MySQL Admin" web interface to do the same thing on all platforms. This interface can be downloaded from http://download.moodle.org/modules/integrations.php. It is an integration of PHPMyAdmin for the Moodle administration interface.

Install the new Moodle software

Using a downloaded archive

Do not overwrite an old installation unless you know what you are doing ... sometimes old files can cause problems in new installations. The best way is to rename the current Moodle directory to something else, then unpack the new Moodle archive into the old location.

mv moodle moodle.backup
tar xvzf moodle-1.1.tgz

Next, copy across your config.php and any other plugins such as custom themes:

cp moodle.backup/config.php moodle
cp -pr moodle.backup/theme/mytheme moodle/theme/mytheme

Using CVS

You can use CVS for updating or upgrading your Moodle. First you need to do a CVS checkout in your (empty) Moodle root directory.

For Linux servers

To do a CVS checkout of Moodle, you first have to logon to the Moodle CVS server.

 cvs -d:pserver:anonymous@moodle.cvs.sourceforge.net:/cvsroot/moodle login
 No password for anonymous, so just hit the Enter button.

Go to the directory where you want the Moodle root to come and type

 cvs -z3 -d:pserver:anonymous@moodle.cvs.sourceforge.net:/cvsroot/moodle
  co -r MOODLE_15_STABLE moodle 
 (where MOODLE_15_STABLE is the desired version)

To update, just go into the Moodle root directory and update to the new files:

 cvs update -dP

Make sure you use the "d" parameter to create new directories if necessary, and the "P" parameter to prune empty directories.

For Windows servers

You can use Tortoise CVS to do the initial checkout and the updates.

If you have been editing Moodle files, watch the messages very closely for possible conflicts. All your customised themes and non-standard plugins will be untouched.

Don't forget to visit the admin page after the CVS update proces has completed.

Finishing the upgrade

The last step is to trigger the upgrade processes within Moodle.

To do this just visit the admin page of your installation e.g. http://example.com/moodle/admin

It doesn't matter if you are logged in as admin or not.

Moodle will automatically detect the new version and perform all the database or filesystem upgrades that are necessary. If there is anything it can't do itself (very rare) then you will see messages telling you what you need to do.

Assuming all goes well (no error messages) then you can start using your new version of Moodle and enjoy the new features!

See also