I have old database with valuable data which was in latin1_swedish_ci collation. I am now trying to convert it to utf8 but I have problems.
I have tried everything and read every article I found. I have several databases and some of this techniques were effective to some database, but are not to this one.
First of all I tried this, which worked on different database
UPDATE tt_news SET
title=convert(cast(convert(title using latin1) as binary) using utf8),
short=convert(cast(convert(short using latin1) as binary) using utf8),
bodytext=convert(cast(convert(bodytext using latin1) as binary) using utf8)
WHERE 1
and it is truncating my data from Balaševiæevi to Bala
Then I tried converting database using this
mysqldump -u root -p mydb -c -e --default-character-set=utf8 --single-transaction --skip-set-charset --add-drop-database -B mydb > dump.sql
sed 's/DEFAULT CHARACTER SET latin1/DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci/' <dump.sql | sed 's/DEFAULT CHARSET=latin1/DEFAULT CHARSET=utf8/' >dump-fixed.sql
mysql -u root -p mydb < dump-fixed.sql
Everything is converted to utf8_general_ci, and data is not truncated but I still have problems with it because characters are not showing as they should.