Upgrade moodle 1.9+ to 2.0+

there are 2 way how to upgrade:
1. Using php script.
Copy this script and save to convertdata.php. Save this script/file to folder moodle. Make sure you change database's name, username and password mysql to the correct one. If your database size to big, please read the comment in the script.


<?php
// please increase max execution time to 300, example max_execution_time = 300
//mysql_connect("localhost","db_user","db_password");
mysql_connect("localhost","root","root");
//mysql_select_db("db_name");
$dbname=mysql_select_db("xsmachdb");
// convert database to format utf8_bin
// ALTER DATABASE `database-name` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin
echo "------------convert database to format utf8-bin -------------";
mysql_query("ALTER DATABASE $dbname DEFAULT CHARACTER SET utf8 COLLATE utf8_bin");
// convert all table
$res = mysql_query("SHOW TABLES");
while ($row = mysql_fetch_array($res))
{
foreach ($row as $key => $table)
{
mysql_query("ALTER TABLE " . $table . " CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin");
echo $key . " => " . $table . " CONVERTED
";

}
}
echo "----------all table was converted-----------"
?>


How to run this script. Just type, http://www.yourdomain.com/convertdata.php, example www.smsplong.edu.my/convertdata.php

This example what I was done. (part of them)
------------convert database to format utf8-bin -------------
0 => adodb_logsql CONVERTED
Tables_in_xsmachdb => adodb_logsql CONVERTED
0 => mdl_assignment CONVERTED
Tables_in_xsmachdb => mdl_assignment CONVERTED
0 => mdl_assignment_submissions CONVERTED
Tables_in_xsmachdb => mdl_assignment_submissions CONVERTED
0 => mdl_backup_config CONVERTED
Tables_in_xsmachdb => mdl_backup_config CONVERTED
0 => mdl_backup_courses CONVERTED
Tables_in_xsmachdb => mdl_backup_courses CONVERTED
0 => mdl_backup_files CONVERTED
Tables_in_xsmachdb => mdl_backup_files CONVERTED
0 => mdl_backup_ids CONVERTED
Tables_in_xsmachdb => mdl_backup_ids CONVERTED
0 => mdl_backup_log CONVERTED
Tables_in_xsmachdb => mdl_backup_log CONVERTED
0 => mdl_block CONVERTED
Tables_in_xsmachdb => mdl_block CONVERTED
0 => mdl_block_instance CONVERTED
Tables_in_xsmachdb => mdl_block_instance CONVERTED
0 => mdl_block_pinned CONVERTED
Tables_in_xsmachdb => mdl_block_pinned CONVERTED
0 => mdl_block_rss_client CONVERTED
Tables_in_xsmachdb => mdl_block_rss_client CONVERTED
0 => mdl_block_search_documents CONVERTED

2. This is example what I was done using PhpMyAdmin.

Note: I fail to log in using admin or any admin members. Any way all student can log in. Very funny.

Comments

MOKHTAR ISMAIL said…
wa tabik spring la sama lu... jarang manusia boleh buat ni weh!!

Popular posts from this blog

How to Install ‘IPFire’ Free Firewall Linux Distribution

Installing Moodle on a Debian-based LAMP server

Step by Step Installasi Mikrotik Router x86 pada ProxMox 3.2 Virtual Server