Upgrade Dokeos 1.5.x to Dokeos 1.6
From Dokeos
Write down here considerations to take into account for creating the upgrade script.
Contents |
Changing course tables
Some Dokeos installations are very large. We don't want the upgrade function to stop half-way so it's best to provide an option to update a number of course databases, e.g. if there are one thousand courses, provide linkt to update a hundred at once. Do not assume all dokeos admins can increase the php script time limit.
File structure
All course folders are now stored in a courses folder. For upgrading this means
- the course folders have to be moved into the courses directory
- the index.php page inside every course folder has to be changed (best is probably to delete it and rewrite from scratch). This is necessary because the course imports another script using a relative path.
Database structure changes
The database structure has changed a lot recently, so there is a lot to do in getting data from a 1.5.5 database and feeding it into 1.6.
Yannick will probably do the database part of the upgrade.
FIXED - get_lang function
The get_lang function has been modified to include language files:
include($includePath."/../lang/".$languageInterface."/$langFile.inc.php"); include($includePath."/../lang/".$languageInterface."/trad4all.inc.php");
(this is to help with the translation process)
These always get included, even if the server is not a test / development server. This causes a performance hit, we should rewrite the function before stable release.
- UPDATE - the performance issue has been fixed by Ren�.
Getting courses from your old portal
currently this is disabled functionality in the index.php it should perhaps return claroline/install/update_courses.php
Course visibility settings
Mapping old settings (one field visibility, only few options) to the new settings (three fields, much more options). Dokeos 1.5.x contained one field visibility; which contained both info about the visibility and also wether or not subscribing was allowed. In Dokeos 1.6, this doubling has been eliminated, visibility now deals ony with course visibility and there is a separate field for wether or not subscribing is allowed.
NOT_VISIBLE_NO_SUBSCRIPTION_ALLOWED --> COURSE_VISIBILITY_REGISTERED, SUBSCRIBE_NOT_ALLOWED NOT_VISIBLE_SUBSCRIPTION_ALLOWED --> COURSE_VISIBILITY_REGISTERED, SUBSCRIBE_ALLOWED VISIBLE_SUBSCRIPTION_ALLOWED --> COURSE_VISIBILITY_OPEN_PLATFORM, SUBSCRIBE_ALLOWED VISIBLE_NO_SUBSCRIPTION_ALLOWED --> COURSE_VISIBILITY_OPEN_PLATFORM, SUBSCRIBE_NOT_ALLOWED
AWACS
Move the config settings that are in claro_main.conf.php to the settings_current table.
Item properties
All the old material have to have their properties moved to the item_property table. For the Agenda for instance I used the following sanity checks
/*
==============================================================================
SANITY CHECK
==============================================================================
*/
// the visibility for this tool is now based on the item_properties table all the items
// of the 'calendar_event' table must have an entry in 'item_properties' or it will not be shown here.
// This part of the code should realy go into the update script op dokeos, but as the check
// requires only two sql statements and the process of inserting a reference to the agenda items in
// 'item_properties'
// step 0: we alter the table item_properties so that it adds all the newly added fields (no longer needed as dd_course.linb.inc.php is updated
// step 1: we grab all the ids of the agenda items of the 'item_properties' table
$sql_select="SELECT * FROM `".$TABLE_TOOLEDIT."` WHERE tool='Agenda'";
$agenda_tooledit_ref=array("0");
$result = mysql_query($sql_select) or die (mysql_error());
while ($row=mysql_fetch_array($result))
{
$agenda_tooledit_ref[]=$row['ref'];
}
// step 2: we select the ids of the 'calendar_event' table that do not occur in $agenda_tooledit_ref array
if (is_array($agenda_tooledit_ref))
{
$sql_select="SELECT * FROM `".$TABLEAGENDA."` WHERE id NOT IN (".implode(", ", $agenda_tooledit_ref).")";
$result = mysql_query($sql_select) or die (mysql_error());
while ($row=mysql_fetch_array($result))
{
$agenda_tooledit_new[]=$row['id'];
}
}
// step 3: we insert the ids of the 'calendar_event' table that do not occur in 'last_tooledit'
// as an agenda item for all users.
if (is_array($agenda_tooledit_new))
{
foreach ($agenda_tooledit_new as $ref)
{
$sql_insert="INSERT INTO `".$TABLE_TOOLEDIT."` (tool, last_date, ref, type, user_id, to_group_id, to_user_id, visible) VALUES ('$nameTools', '2004-09-01 00:00:00', '$ref', '".addslashes($lang_new_agenda)."', '0', '0', '0','1')";
$result = mysql_query($sql_insert) or die (mysql_error());
}
}
group_id has to be renamed to to_group_id. This was introduced before as a remedy for the group fora.
Documents
Document properties (also visibility!) are now stored in the item_property table.
We will need a script that collects all the information before altering the tables.
As there were some problems in the previous versions with getting extracted zip files in the database we'd better do a crawl of the documents folder and add those files that are missing.
dokeos_user database
- creating a new database for storing the user related stuff: personal agenda, course sorting. For the moment the name of this database is hardcoded into install/install_db.inc.php, but there should be an additional field in the installation procedure to give this database a name (default name: dokeos_user
- this has also to go into claro_main.conf.php
- added a new api function for this: Database::get_user_personal_database()
Things not taken into account
Virtual courses
When updating the database of all courses, the upgrade script should skip virtual course entries because they share a database with another course. A database should not be updated twice.
The new API function CourseManager::is_virtual_course_from_system_code($system_code) can be used to check wether a course is a virtual course.
example resources
example links, agenda items, announcements, documents have no entry in item_property and will therefore not show
Dokeos 1.8
See the article called Upgrade Dokeos 1.6.x to Dokeos 1.8

