Forum

Migrating existing ...
 
Notifications
Retirer tout

Migrating existing DB to UTF-8 ?

2 Posts
2 Utilisateurs
0 Reactions
4,125 Vu
 Dan
(@caccia)
Posts: 340
Contributor
Début du sujet
 
[#2050]

Hi all,

I wanted to move to UTF-8 in my existing DB, mainly because I use ODBC with Excel files to store some project information outside of Projeqtor (for keeping track of historical left & real work, for example). In the initial configuration of my DB (not stricly UTF8), when importing data to XLS in ths way accented characters (French "é" for example) are incorrectly displayed.

I've read some info concerning character set settings in the DB, in particular this thread: http://www.projeqtor.org/index.php/en/kunena-2/2-submit-issues/5799-utf8-on-display,-wrong-in-database-because-twice-converted-solved?start=18

After updating the server settings for character set, I am able to get all new entries working correctly: for example if I enter a name "Définition", it is correctly displayed in Projeqtor, in PHPMyAdmin, Excel, everything - nice 🙂 ("é" is now encoded as 0x82).

My only remaining problem is for existing items in the DB: the "é" character was encoded as 0xC3A9 initially, so in my "new" UTF-8 environment, they are displayed as rubbish.

So my question is : did anyone manage to migrate the contents of an existing DB from "old-style" (Latin1 I guess) to UTF-8 ? And if so, how ? 😉

I'll keep looking elsewhere , this should be a generic question, but just wondering if anyone went through this process.

Thanks !
caccia

P.S: Oh yeah, FYI in case anyone is wondering, in command-line MySql using Windows cmd.exe, the display is wrong even with newly configured UTF-8 DB - but after spending a lot of time wondering what was wrong, it seems the problem lies with Windows' cmd.exe & MySql 5.5 itself: http://bugs.mysql.com/bug.php?id=66682


 
Posté : 17 Oct PM 16:1010
(@babynus)
Posts: 14952
Membre Admin
 

Hi Caccia,

The problem is that even if you convert MySql server, existing data is not converted.
So what you need to do is :
- export data
- convert server (on configuration side)
- convert exported datafile (take car that even if you used UTF-8 export, data may be in ISO format) : using advanced editor like Notepad++ is fine.
- import converted data file.

I did it. It works.


 
Posté : 17 Oct PM 17:1010
Share:
Retour en haut