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

Upgrading: Difference between revisions

From MoodleDocs
No edit summary
m (Reverted edits by GigaRusAC (talk) to last version by Helen Foster)
Line 1: Line 1:
Система Moodle позволяет обновление от версии к версии. Пожалуйста, для более подробного ознакомления с обновляемой версией перейдите по ссылкам Upgrading to Moodle 1.6, Upgrading to Moodle 1.8 или Upgrading to Moodle 1.9.
Moodle is designed to upgrade cleanly from one version to the next. Please refer to [[Upgrading to Moodle 1.6]], [[Upgrading to Moodle 1.8]] or [[Upgrading to Moodle 1.9]]  for particular considerations related to the upgraded version.


Изменения, внесенные в исходный код, такие как установка вспомогательного модуля (не стандартного модуля) или редактирование на сайте php-файла могут не обновиться. Сюда же включаются модификации стандартных тем, которые будут переписаны в процессе обновления.
Changes that have been made to the original code, such as installing a contributed module (non-standard module) or a site edit of a php file, may not upgrade. This includes modifications to standard themes, that will be overwritten during an upgrade.
 
For those using cpanel, you can use [http://ic.eflclasses.org/tutorials/howtoupgrademoodlewithcpanel.swf this tutorial]. It is a bit rough around the edges and is a little dated, but you should get the idea.


Для использования cpanel можно воспользоваться ссылкой [http://ic.eflclasses.org/tutorials/howtoupgrademoodlewithcpanel.swf this tutorial]. Несмотря на некоторые неровности по краям и небольшую устарелость, идея должна быть ясна.


__TOC__
__TOC__


Обновляйте версию Moodle по следующим шагам:
When upgrading a Moodle installation you should follow these steps:


==Проверка системных требований==
==Check the requirements==
Spend some time re-reading the [[Installing Moodle | installation documentation]] and documentation for the new version. Check the system requirements for the target version you want to upgrade-to in ''Administration > Server > [[Environment]]''.


Ознакомтесь с инструкцией по установке и документацией на новую версию. Проверьте системные требования для версии, которую вы хотите обновить на ''Administration > Server > [[Environment]]''.
== 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.


Всегда полезно, хотя и не строго обязательно, делать резервную копию любой системы перед ее серьезным обновлением на случай, если придется вернуться к старой версии. Вообще, очень практично настроить Ваш сервер для ежедневного обновления версии Moodle и просто пропустить этот шаг.
There are three areas that need backing up:


Рассмотрим три области, нуждающиеся в резервировании:
=== 1. The Moodle software directory itself ===


=== 1. Собственно программная директория Moodle===
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


Сделайте отдельную копию этих файлов перед обновлением, что позволит восстановить файл config.php и любые модули, которые были добавлены как темы, языки и т. д.  
=== 2. Your data directory ===


=== 2. Ваша папка данных  ===
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 ===


=== 3. Ваша база данных ===
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":
 
Большинство обновлений Moodle изменяют таблицы баз данных, добавляя или изменяя поля. Существую разные способы резервирования для каждой базы данных. Один из способов резервирования базу данных MySQL состоит в "выгрузке" ее в один SQL-файл. Приведенный ниже пример иллюстрирует Unix команды для загрузки в файл базы данных под названием "moodle":


  mysqldump -u username -p -C -Q -e -a moodle > moodle-backup-2007-04-01.sql
  mysqldump -u username -p -C -Q -e -a moodle > moodle-backup-2007-04-01.sql
(Ключ "-a" не желателен и должен быть заменен на "--create-options")
(The "-a" switch is deprecated and should be replaced by "--create-options")


Замените учетную запись в базе данных на имя пользователя. Флаг -p указывает на пароль для пользователя под флагом -u.
Substitute your database user account for username. The -p flag will prompt you for the password for the username specified by -u.


Если хост базы данных отличается от хоста, на котором Вы хотите выполнить команду резервирования (обычно это web-сервер)нужно при выполнении дампа MySQL указать его с опцией -h:
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  
  mysqldump -u username -p -h databasehost -C -Q -e -a moodle > moodle-backup-2007-04-01.sql  


Вы также модете воспользоваться функцией экспорта "Export" в опции web-интерфейса Moodle "MySQL Admin" для выполнения этой же операции на любой платформе. В версии Moodle v1.9 и выше эта опция находится в меню '''Site Administration''' -> '''Server''' -> '''Database'''. Этот интерфейс можно также загрузить со страницы http://download.moodle.org/modules/integrations.php. Это компоновка PHPMyAdmin с интерфейсом администратора Moodle.
You can also use the "Export" feature in Moodle's optional "MySQL Admin" web interface to do the same thing on all platforms. In Moodle v1.9 and greater, this is located in '''Site Administration''' -> '''Server''' -> '''Database'''. This interface can also be downloaded from http://download.moodle.org/modules/integrations.php. It is an integration of PHPMyAdmin for the Moodle administration interface.


==== Замечания перед дампом SQL ====
==== SQL dump caveats ====


* Пожалуйста, учтите, что для дампа SQL mysqldump существует множество опций. Необходимо проконсультироваться с Вашим системным администратором (если такой человек имеется) или другим специалистом чтобы выяснить, нет ли на сайте специальных флагов, которые нужно использовать для дампа SQL.
* Please note that there are a '''LOT''' of options possible for mysqldump. Please talk with your Systems Administrator (if you have one) or similar to see if there are site-specific flags you should use for your SQL dump.
** Например, если Вы с собственной MySQL 5.2 переходите к системе, использующей MySQL 5.0 или 4.1, Вам обязательно нужно использовать флаг "--compat=mysql40". (Это не так уж нехарактерно для ситуаций, которые раскрывают природу ISP-хостинга в сравнении с локальной пользовательской установкой Moodle)
** For example, if your local installation is running MySQL 5.2 and you are moving to a system running MySQL 5.0 or 4.1, you really ought to use the "--compat=mysql40" flag. (This is not too uncommon of a situation given the nature of ISP hosting as compared to local user Moodle setups)
* Несмотря на всю очевидность, нужно четко понимать: эти инструкции подходят только для дампа из MYSQL! Postgresql, Oracle и другие серверы баз данных имеют другие средства для дампа баз данных.
* This seems obvious, but should be said outright: These instructions only work for dumping from MySQL! Postgresql, Oracle, and other database servers have different tools to dump databases.
* Для приведенного выше примера с командами импорта mysql, Вам нужно использовать флаг --no-create-db. Если Ваша база данных локально названа не так, как на сайте перемещения, отсутствие этого флага приведет к возникновению проблем.
* Given the example mysql import lines, above, you really should use the --no-create-db flag. If your database locally is named something differently from the migration site, not including this flag could cause problems.


== Установка нового программного обеспечения Moodle ==
== Install the new Moodle software ==


=== Использование загружаемого архива ===
=== Using a downloaded archive ===


@Не ставте новую версию поверх старой если вы не уверены, что делаете правильно... некоторые старые файлы могут вызвать сбои в работе новой версии. Лучше всего переименовать текущую директорию Moodle, затем распаковать архив новой версии Moodle по старому адресу.  
@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.


  Linux
  Linux
Line 59: Line 59:
  tar xvzf moodle-1.1.tgz
  tar xvzf moodle-1.1.tgz


Затем скопируйте файл config.php, любые другие плагины как например пользовательские темы, и Ваш .htaccess файл, если Вы его создавали:
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 moodle.backup/config.php moodle
  cp -pr moodle.backup/theme/mytheme moodle/theme/mytheme
  cp -pr moodle.backup/theme/mytheme moodle/theme/mytheme


И не забудьте
Don't forget to


sudo chown www-data moodle/config.php
sudo chown www-data moodle/config.php


если нужно.
if necessary.


Где www-data - какой пользователь Apache стоит на Вашей системе. Это обычно 'apache' or 'www'.
where www-data is whatever user the Apache user is on your system. This is often 'apache' or 'www'.
Это можно выяснить с помощью 'ls -l' в Вашей директории /var/www/moodle (или там, где находится Ваш Moodle сайт), посмотрев "владельца" и группу.
You can find out by doing 'ls -l' in your /var/www/moodle folder (or wherever your moodle site is)
and then looking at the owner and group.


Так что можно увидеть что-то вроде
so you may see something like


ls -l
ls -l
Line 83: Line 84:
...lots more lines...
...lots more lines...


таким образом здесь "владельц" - apache, а группа системная.
so the owner is apache and the group is system.  


Для того чтобы повторить это на новой системе можно записать 'chown apache:system config.php'  
To replicate this on your new system you can do  'chown apache:system config.php'  


или для всей группы
or to do a whole group do


chown apache:system ./*
chown apache:system ./*


и реккурентно
and recursively


chown -R apache:system ./*
chown -R apache:system ./*


=== Используя CVS ===
=== Using CVS ===


Вы можете использовать CVS для обновления или установки новой версии Moodle. Для этого в первую очередь выполните CVS проверку в Вашей (пустой) корневой директории Moodle.
You can use CVS for updating or upgrading your Moodle.
First you need to do a CVS checkout in your (empty) Moodle root directory.


Вы можете воспользоваться любой из наших [[CVS_for_Administrators#CVS_Servers|CVS Mirror servers]]. Просто замените '''SERVER.cvs.moodle.org''' в указанных ниже командах на имя зеркального сервера, котолрый вы выбрали!.
You can use any of our [[CVS_for_Administrators#CVS_Servers|CVS Mirror servers]]. Just replace '''SERVER.cvs.moodle.org''' in the instructions below with the name of the mirror server you chose!.


'''Для серверов Linux'''
'''For Linux servers'''


Для выполнения CVS проверки Moodle, прежде всего нужно зарегестрироваться на CVS сервере Moodle.
To do a CVS checkout of Moodle, you first have to logon to the Moodle CVS server.


   <nowiki>cvs -d:pserver:anonymous@SERVER.cvs.moodle.org:/cvsroot/moodle login</nowiki>
   <nowiki>cvs -d:pserver:anonymous@SERVER.cvs.moodle.org:/cvsroot/moodle login</nowiki>
   Без пароля для анонимности, так что просто кликните на Enter.
   No password for anonymous, so just hit the Enter button.


Перейдите к директории, где Вы собираетесь держать корневую папку Moodle
Go to the directory where you want the Moodle root to come and type


   <nowiki>cvs -z3 -d:pserver:anonymous@SERVER.cvs.moodle.org:/cvsroot/moodle co -r MOODLE_18_STABLE moodle</nowiki>  
   <nowiki>cvs -z3 -d:pserver:anonymous@SERVER.cvs.moodle.org:/cvsroot/moodle co -r MOODLE_18_STABLE moodle</nowiki>  
   (where MOODLE_18_STABLE is the desired version)
   (where MOODLE_18_STABLE is the desired version)


Для обновления просто перейдите в корневую папку Moodle и обновите файлы:
To update, just go into the Moodle root directory and update to the new files:


   cvs update -dP
   cvs update -dP
Для обновления на новую версию наберите следующую команду и замените 18 на номер самой новой версии
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
   cvs -Q update -dP -r MOODLE_18_STABLE


Убедитесь, что Вы используете "d" параметр для создания в случае необходимости новых директорий, и "P" параметр для удаления пустых папок.
Make sure you use the "d" parameter to create new directories if necessary, and the "P" parameter to prune empty directories.


'''Для серверов Windows'''
'''For Windows servers'''


Для выполнения начальной проверки и обновления можно использовать Tortoise CVS.
You can use Tortoise CVS to do the initial checkout and the updates.


Если Вы редактируете файлы Moodle, внимательно следите за сообщениями о возможных сбоях. Все Ваши пользовательские темы и нестандартные плагины останутся нетронутыми.
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.


Не забудьте зайти на страницу администратора после завершения CVS обновления.
Don't forget to visit the admin page after the CVS update process has completed.


== Завершение обновления ==
== Finishing the upgrade ==


Последний шаг -  инициализация обновлений внутри Moodle.
The last step is to trigger the upgrade processes within Moodle.


Для этого зайдите на страницу администратора Ваших установок, например ''<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. If you are upgrading from some older versions you would not be able to login before the upgrade anyway.


Moodle автоматически определит новую версию и выполнит все необходимые обновления базы данных или файловой системы. Если какие-то операции система не сможет сделать самостоятельно (что случается крайне редко), Вы увидите соответствующие сообщения с указанием Ваших действий.
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.


Если все прошло хорошо (нет сообщений об ошибках), то можно начинать пользоваться новой версией Moodle и получать удовольствие от новых возможностей!
Assuming all goes well (no error messages) then you can start using your new version of Moodle and enjoy the new features!


Имейте пожалуйста в виду, что если Вы используете крупномасштабный сайт Moodle (например, более 10 тысяч курсов и 40 тысяч пользователей), то нужно убедиться, перед тем как обновиться на Moodle 1.8.x, что Вы выполняете свое собственное профилирующее тестирование, так как для установки крупной пользовательской базы в версии 1.8.x имеется все еще всего несколько свободных тематик.
Please note that if you are running a large scale of moodle site (e.g. have more tha 10,000+ courses and 40,000+ users), make sure that you do your own performance profiling testing before you upgrade to Moodle 1.8.x, as there are still quite a few outstanding (unresolved) performance issues in 1.8.x for large user base installations.


== Проверка обновления (необязательно) ==
== Verify the upgrade (optional) ==


Если Вы хотите убедиться, что описание базы данных в обновленной базе совпадает с описанием новой, чистой установки (как должно быть), можно открыть [[Verify Database Schema]].
If you wish to confirm that the database definitions in the upgraded database match the definitions of a new, clean install (which they should) you might like to look at [[Verify Database Schema]].


==Обновление нескольких версий==
==Upgrading more than one version==


В общем случае, рекомендуется выполнять обновление последовательно от версии к версии Moodle, например 1.7 -> 1.8 -> 1.9. Исключение составляет обновление версии 1.5 на 1.6, когда рекомендуется пропустить версию 1.7, то есть обновлять 1.5 -> 1.6 -> 1.8 -> 1.9. (Главная причина этой рекомендации заключается в том, что установки по умолчанию, определяемые обновлением к верии 1.7, не идеальны в дальнейшем для версии 1.8.)
In general, it is recommended to upgrade via each version of Moodle, for example 1.7 -> 1.8 -> 1.9. An exception to this is when upgrading from 1.5 or 1.6, when it is recommended that 1.7 is skipped, in other words upgrade 1.5 -> 1.6 -> 1.8 -> 1.9. (The main reason for this recommendation is that the default roles settings obtained when upgrading to 1.7 are not ideal for 1.8 onwards.)


==Смотреть также==
==See also==


*[[Installing Moodle]]
*[[Installing Moodle]]
Line 172: Line 174:
[[Category:Installation]]
[[Category:Installation]]


[[ru:Обновление]]
 
[[es:Actualización de moodle]]
[[es:Actualización de moodle]]
[[fr:Mise à jour]]
[[fr:Mise à jour]]

Revision as of 20:34, 14 March 2009

Moodle is designed to upgrade cleanly from one version to the next. Please refer to Upgrading to Moodle 1.6, Upgrading to Moodle 1.8 or Upgrading to Moodle 1.9 for particular considerations related to the upgraded version.

Changes that have been made to the original code, such as installing a contributed module (non-standard module) or a site edit of a php file, may not upgrade. This includes modifications to standard themes, that will be overwritten during an upgrade.

For those using cpanel, you can use this tutorial. It is a bit rough around the edges and is a little dated, but you should get the idea.


When upgrading a Moodle installation you should follow these steps:

Check the requirements

Spend some time re-reading the installation documentation and documentation for the new version. Check the system requirements for the target version you want to upgrade-to in Administration > Server > Environment.

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

(The "-a" switch is deprecated and should be replaced by "--create-options")

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. In Moodle v1.9 and greater, this is located in Site Administration -> Server -> Database. This interface can also be downloaded from http://download.moodle.org/modules/integrations.php. It is an integration of PHPMyAdmin for the Moodle administration interface.

SQL dump caveats

  • Please note that there are a LOT of options possible for mysqldump. Please talk with your Systems Administrator (if you have one) or similar to see if there are site-specific flags you should use for your SQL dump.
    • For example, if your local installation is running MySQL 5.2 and you are moving to a system running MySQL 5.0 or 4.1, you really ought to use the "--compat=mysql40" flag. (This is not too uncommon of a situation given the nature of ISP hosting as compared to local user Moodle setups)
  • This seems obvious, but should be said outright: These instructions only work for dumping from MySQL! Postgresql, Oracle, and other database servers have different tools to dump databases.
  • Given the example mysql import lines, above, you really should use the --no-create-db flag. If your database locally is named something differently from the migration site, not including this flag could cause problems.

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.

Linux
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

Don't forget to

sudo chown www-data moodle/config.php

if necessary.

where www-data is whatever user the Apache user is on your system. This is often 'apache' or 'www'. You can find out by doing 'ls -l' in your /var/www/moodle folder (or wherever your moodle site is) and then looking at the owner and group.

so you may see something like

ls -l

...lots of lines...

-rw-r--r-- 1 apache system 784 Jun 28 2007 config.php

...lots more lines...

so the owner is apache and the group is system.

To replicate this on your new system you can do 'chown apache:system config.php'

or to do a whole group do

chown apache:system ./*

and recursively

chown -R apache:system ./*

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.

You can use any of our CVS Mirror servers. Just replace SERVER.cvs.moodle.org 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@SERVER.cvs.moodle.org:/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@SERVER.cvs.moodle.org:/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 process 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. If you are upgrading from some older versions you would not be able to login before the upgrade anyway.

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!

Please note that if you are running a large scale of moodle site (e.g. have more tha 10,000+ courses and 40,000+ users), make sure that you do your own performance profiling testing before you upgrade to Moodle 1.8.x, as there are still quite a few outstanding (unresolved) performance issues in 1.8.x for large user base installations.

Verify the upgrade (optional)

If you wish to confirm that the database definitions in the upgraded database match the definitions of a new, clean install (which they should) you might like to look at Verify Database Schema.

Upgrading more than one version

In general, it is recommended to upgrade via each version of Moodle, for example 1.7 -> 1.8 -> 1.9. An exception to this is when upgrading from 1.5 or 1.6, when it is recommended that 1.7 is skipped, in other words upgrade 1.5 -> 1.6 -> 1.8 -> 1.9. (The main reason for this recommendation is that the default roles settings obtained when upgrading to 1.7 are not ideal for 1.8 onwards.)

See also

Using Moodle forum discussions: