Help with a big Upgrade

The MIGRATION script is amazing!

by Timothy Takemoto -
Number of replies: 1

I am thrilled by the effectiveness of the migration script that just succeeded in updating my latin encoded UTF-8 content database into a UTF-8 database.

The migration script succeeded where even editing by hand, editing backup files by hand, conversion utilities (jconv, kanjiconverter - which are good in their way) and text editors failed. I tried to use regex to remove the garbled Japanese but some of the characters were so weird that they could not be copied or recognised by the search, or copy.

I have had so much trouble with moving between EUC-JP to (alas latin encoded due to the age of MySQL) UTF-8, and bearing in mind the old site does not have a 4.1.9 or above database, I was not even going to bother trying to upgrade my 1.5.x site.

But just now (encouraged by Frank)
1) I downloaded my 1.6.2 moodle files over the top of the 1.5.x in my PC
2) I downloaded MySQL 4.1.21 "Windows (x86)" unzipped and ran the "Custom" setup.exe, pointing the installer to easyphp/mysql (see attached screen shot)
3) Ran the upgrade and migration script and....wah..it worked.

Whoever did this is a genius. I thought I would have to spend all day and night recreating my courses this term. It looks like I am just going to be able backup, restore and import. Fingers crossed.

Thanks very much!

Tim

Attachment custom.jpg
In reply to Timothy Takemoto

Re: The MIGRATION script is amazing!

by Timothy Takemoto -

The migration script when really well when I was upgrading a Latin encode database, UTF-8 contents site. At fist I had problems with my old EUC-JP contents in the form of backed up course files from 2 and a half years ago. I restored these contents into 1.5.2 moodles and tried upgrading.  

When the site language is set to EUC-JP the screen (displayed in UTF-8) is of course so garbled I don't know what is going on. I don't think the database migration script is displayed.

When the site language is set to en the option to migrate the database is not offered.

I eventually found the the migration script at
../moodle/admin/utfdbmigrate.php
But when I go there it tells me that "the migration has already been performed". However, in the file utfdbmigrate there is a line

    if (!empty($CFG->unicodedb)) {
        error ('unicode db migration has already been performed!');
    }

So I added
$CFG->unicodedb = "";

To the (moodle created) config.php (which not specification). And presto! But alas, this time the migration did not work (...) at first. Now it does. The reason...

I tried a variety of database formats.

I tried the old EUC-JP contents on a EUC-JP database but the contents would not display.

I tried the  old EUC-JP contents on a new moodle with UTF-8 database and everything displayed fine. But when I uploaded that it would not offer me the migration option and when forced the migration using the above technique, the migration did not work.

I tried Latin1 (western languages) and the EUC-JP database contents displayed fine (with the site on EUC-JP). Upgrading worked fine and the migration script, called automatically, migrated fine.

The moral of this story....
Do not create a new UTF-8 database prior to the migration or moodle will think you have migrated already!
Use the same database encode as was originally used to create the contents, bearing in mind that this may be DIFFERENT, from the encoding of the contents!
Now I have two textbooks worth of quizzes, and literally hundreds of suffering students. Tomorrow the world...smile

Tim