Atualização de versão do Moodle: Difference between revisions

From MoodleDocs
No edit summary
Line 29: Line 29:


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.
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, any other plugins such as custom themes, and your .htaccess file if you created one:
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.
Until 25th April 2007, we only had one server available for anonymous CVS (moodle.cvs.sourceforge.net). Unfortunately this server is now disabled. But you can use any of the [[CVS_for_Administrators#CVS_Servers|CVS Mirror servers]]. Just replace '''moodle.cvs.sourceforge.net''' in the instructions below with the name of the mirror server you chose!.
'''For Linux servers'''
To do a CVS checkout of Moodle, you first have to logon to the Moodle CVS server.
  <nowiki>cvs -d:pserver:anonymous@moodle.cvs.sourceforge.net:/cvsroot/moodle login</nowiki>
  No password for anonymous, so just hit the Enter button.
Go to the directory where you want the Moodle root to come and type
  <nowiki>cvs -z3 -d:pserver:anonymous@moodle.cvs.sourceforge.net:/cvsroot/moodle co -r MOODLE_18_STABLE moodle</nowiki>
  (where MOODLE_18_STABLE is the desired version)
To update, just go into the Moodle root directory and update to the new files:
  cvs update -dP
To update to a new version type in the following and change 18 to whatever newest version upgrade number is
  cvs -Q update -dP -r MOODLE_18_STABLE
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.

Revision as of 21:24, 15 November 2007

Antes, verifique os requisitos do sistema

Gaste algum tempo relendo a documentação de instalação. Verifique os requisitos de sistema para a versão que você está atualizando em Administração > Servidor > Ambiente.

Backup de dados importantes

Embora não seja estritamente necessário, é sempre uma boa idéia fazer um backup de qualquer sistema de produção antes de uma grande atualização, apenas para o caso de você precisar voltar para a versão mais antiga, por algum motivo. De fato, é uma boa idéia para automatizar o seu servidor de backup de seu Moodle diariamente, de modo que você pode saltar este passo.

Há três áreas que precisam que seja feito backup:

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-2007-04-01.sql

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

If your database host is different from the host you want to execute the backup command (usually the web server), you have to specify it with the -h option to mysqldump:

mysqldump -u username -p -h databasehost -C -Q -e -a moodle > moodle-backup-2007-04-01.sql 

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, any other plugins such as custom themes, and your .htaccess file if you created one:

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.

Until 25th April 2007, we only had one server available for anonymous CVS (moodle.cvs.sourceforge.net). Unfortunately this server is now disabled. But you can use any of the CVS Mirror servers. Just replace moodle.cvs.sourceforge.net in the instructions below with the name of the mirror server you chose!.

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_18_STABLE moodle 
 (where MOODLE_18_STABLE is the desired version)

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

 cvs update -dP

To update to a new version type in the following and change 18 to whatever newest version upgrade number is

 cvs -Q update -dP -r MOODLE_18_STABLE

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.