mantisbt:upgrade_to_utf8
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| mantisbt:upgrade_to_utf8 [2007/07/08 16:37] – created vboctor | mantisbt:upgrade_to_utf8 [2013/06/10 12:18] (current) – atrol | ||
|---|---|---|---|
| Line 6: | Line 6: | ||
| This HOW TO describes the issues that are involved with upgrading from 1.0.x releases (or ones old than those) to 1.1.0x releases, since in the 1.1.0x releases Mantis was changed to use UTF8 language files and encoding for database saved and read from the database. | This HOW TO describes the issues that are involved with upgrading from 1.0.x releases (or ones old than those) to 1.1.0x releases, since in the 1.1.0x releases Mantis was changed to use UTF8 language files and encoding for database saved and read from the database. | ||
| + | |||
| ===== Details ===== | ===== Details ===== | ||
| Line 37: | Line 38: | ||
| actively use multiple encodings within single Mantis installation, | actively use multiple encodings within single Mantis installation, | ||
| should simply run the conversion routine provided below. | should simply run the conversion routine provided below. | ||
| + | |||
| B. (For the expert users) If your database was previously set to any | B. (For the expert users) If your database was previously set to any | ||
| custom encoding, you should export Mantis database to the text file | custom encoding, you should export Mantis database to the text file | ||
| - | manually, then convert this file to utf-8 using iconv, then re-create the | + | manually, then convert this file to utf-8 using iconv (a), then re-create the |
| database in utf-8 or 8859-1, then import the converted file. Or, | database in utf-8 or 8859-1, then import the converted file. Or, | ||
| - | alternatively, | + | alternatively, |
| + | |||
| + | | ||
| + | - After download and install iconv, then I created a new db: | ||
| + | | ||
| + | - convert the file contents using iconv: | ||
| + | iconv -f latin1 -t utf-8 backup_latin1.sql > backup_utf8.sql | ||
| + | - and imported the contents of the converted file into the new database: | ||
| + | mysql -uUser -pPassword bugtracker < backup_utf8.sql | ||
| + | |||
| + | | ||
| + | To convert the database encoding using the mysql tools, just set the character set to UTF-8 when dumping the previous database using: | ||
| + | mysql -uUSER -pPASSWORD INSTANCE --default-character-set=utf8 > mantis-db.sql | ||
| + | And you will get a dump file encoded in UTF-8. After setting up the new database with default character set utf8 you can import this sql script to create the new database schema. | ||
| C. (If multiple encodings are uses in the Mantis, or you have other | C. (If multiple encodings are uses in the Mantis, or you have other | ||
| reasons not to perform conversion) You could skip conversion and just | reasons not to perform conversion) You could skip conversion and just | ||
| Line 121: | Line 137: | ||
| Medium solution: warn to convert manually | Medium solution: warn to convert manually | ||
| Minimal solution: ignore (as such an admin probably knows what to do) | Minimal solution: ignore (as such an admin probably knows what to do) | ||
| + | |||
| + | ===== Web resources ===== | ||
| + | |||
| + | Since this procedure still needs to be refined, we wish to collect here links to other pages with informations and howtos. | ||
| + | Feel free to add your own or comment about the results if you use one of them to perform the upgrade: | ||
| + | |||
| + | * http:// | ||
| + | * [[http:// | ||
| + | * http:// | ||
| + | * http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | |||
| + | ====== Enable CJK Text Entering ====== | ||
| + | |||
| + | **additional notes by tomyjwu** | ||
| + | |||
| + | ===== Introduction ===== | ||
| + | |||
| + | This hack and experience is done in ubuntu 8.04 with | ||
| + | * mantis 1.1.2+dfsg-8~hardy1 | ||
| + | * mysql 5.0.51a-3ubuntu5.4 | ||
| + | |||
| + | The goal is to enable CJK text input on mantis bug descriptions and notes. Two issues must be resolved: | ||
| + | |||
| + | * Mantis database must store descriptions in utf8 by default | ||
| + | * Mantis communicates with mySQL using utf8 way, according to the book by herongyang | ||
| + | |||
| + | Please check the Web resources section for the book URL. | ||
| + | |||
| + | ===== Enable utf8 communications ===== | ||
| + | * Edit the config file / | ||
| + | * add to both server and client section the default encoding | ||
| + | < | ||
| + | | ||
| + | | ||
| + | |||
| + | | ||
| + | | ||
| + | </ | ||
| + | * check setting in mysql command line (mysql -u root -p) | ||
| + | * < | ||
| + | |||
| + | ===== Upgrade the mantis database ===== | ||
| + | * Upgrade 3 levels according to the book by herongyang about mySQL and php. | ||
| + | * Manage mantis database by issuing following commands in mysql command line < | ||
| + | * database level | ||
| + | * altering commands < | ||
| + | * verify by < | ||
| + | * table and column level on mantis_bug_text_table and mantis_bugnote_text_table | ||
| + | * altering commands < | ||
| + | alter table mantis_bug_text_table default character set utf8; | ||
| + | alter table mantis_bug_text_table convert to character set utf8; | ||
| + | alter table mantis_bugnote_text_table default character set utf8; | ||
| + | alter table mantis_bugnote_text_table convert to character set utf8;</ | ||
| + | * verify by < | ||
| + | SHOW CREATE TABLE mantis_bug_text_table; | ||
| + | SHOW CREATE TABLE mantis_bugnote_text_table; | ||
| + | |||
| + | ===== Results ===== | ||
| + | Now you could add a new bug entry in the mantis using web interface and preserve the entered CJK text in utf8 format. Resulted entries are displayed correctly in web browser. Tested with Firefox browser. | ||
| + | |||
| + | |||
| + | |||
| + | |||
mantisbt/upgrade_to_utf8.1183927035.txt.gz · Last modified: (external edit)
