MySQL 3.x to 5.x Conversion
Posted in Advice
First dog watch, 1 bell (4:46 pm)

I had to take a backup from an old MySQL 3.23 server and restore it to a newer server. You may notice that if you try, you get a bunch of errors. Try the following script:

iconv -f latin1 -t utf-8 < backup.sql | sed 's/TYPE=/ENGINE=/g' | sed 's/^---/-- -/g' | sed 's/timestamp(14)/timestamp/g' > outfile.sql

After pushing my old backup through this, I was able to restore the data and run queries against it just fine.

Leave a Comment »