Migration: From MySQL 5 to MySQL 4.1

seagullng - July 18, 2006 - 02:53

I am running Drupal 4.7.2 with some Chinese content (UTF-8 encoded). It's running fine currently with MySQL 5. Since I have to migrate my web portal to a new host a few days later (they only have MySQL 4.1. I didn't realize it when I ordered the hosting plan), I setup a similar site on my new host with the sql dump from MySQL 5. I know there will be problem downgrading from MySQL 5 to MySQL 4.1 because of the UTF issue. So I backup my database from my current host (MySQL 5) and dumped the SQL file into my localhost MySQL 5. Everything was fine.

From command prompt I did: mysqldump -u [user] -p —default-character-set=latin1 [database] > out.sql
to dump a SQL file with UTF -> latin1 conversion hoping that my new host with MySQL 4.1 will accept the content.

To my horror, the web portal on new host shows Chinese characters as garbage text.

Is there any way I can solve this problem? I tried to talk to my new host so that they install MySQL 5, but it's not gonna happen soon. :(

Any help is greatly appreciated!

Re Migration: From MySQL 5 to MySQL 4.1

drupalmania - July 31, 2006 - 17:07

You will need to request UTF-8 plugin installation, while MySQL 5 can be difficult to obtain due to the new licensing of the product, UTF-8 is free and they should do it without moaning, if they don't I would change host (yet again I know :)

UK wholesalers & wholesale suppliers | Dropshippers & dropshipping directory | Dropship products & UK drop ship supplies | Grossisti & fornitori all'ingrosso |

Mysql compatibility mode

eddified - November 15, 2006 - 01:37

I don't know if you need this, but to migrate backwards, the 'compatible' switch to mysqldump may come in handy.

ex:
mysqldump --compatible=mysql40 -u user -p mydatabase > mydatabasedump.sql

you can find more info here:
http://uadmin.blogspot.com/2006/01/mysqldump-compatibility-mode.html

what happens if i move from 5 to 4 then back to 5

gurukripa - August 14, 2007 - 13:06

suppose i am on mysql 5 now..and then move to mysql 4 using the compatible switch u mentioned..and then later when my host upgrades to 5....what happens..will i lose any functionality in all this ????

also what happens if the move is from php5 to php4

(this is my current scenario..i am moving from php5 mysql 5 to php4.4.1 and mysql 4....the new host says..they are upgrading to php5 and mysql 5...they might invite me for the upgrade testing in sometime too....so am just thinking if this downgrade and then upgrade will affect things....and yes, i need to move host NOW !!!!)

pls advise...thanks

i hope migrating to a newer

stephnie - August 17, 2007 - 12:56

i hope migrating to a newer db version shouldn't be a problem.

problem with encoding

jerboa7@drupal.ru - October 23, 2007 - 18:29

I migrated from 4.0.26 to 5.0.x and now have problem with encoding: www.velo100.org. What can I do?

Excellent!

AndriaD - February 27, 2008 - 20:43

Excellent tip and link, thanks very much! I'm facing the exact same scenario, trying to get moved to a faster host, which alas hasn't yet upgraded to MySQL5. Now I'll just email them and find out if dumping my db in compatibility mode 4.0 will make it compatible with their 4.1.22 version.

Thx!

 
 

Drupal is a registered trademark of Dries Buytaert.