Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Has anyone here tried taking a crusty old MySQL 3.23 database and upgrading it all the way to MySQL 5 or 5.1? I've found a little bit of info on this but not a whole lot. What I've read so far is that it's best to not skip a major version number when upgrading. So I would have to go from 3.23 -> 4.xx -> 5.

If anyone out there has direct experience and some advice, I'd love to hear from you.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Tables can be easily migrated. Not a big deal. But the queries are the problem. A lot of changed since 3.23 to 5.x and if you have sqls more complex then select from from bar where 1>2 then they will, most likely .produce different results on 5.x . Operator precedence, embedded functions, et all.
I recommend you run on some non-productions servers the same databases on mysql 3 and 5.x , run all your selects and verify if you get identical results then go for update/insert/delete and whatever you have and run the selects again.
I actually did a mysql 3.23 migration to mysql 5.0.45 for some small dbs , with very simple schema and I had to adjust a lot of queries so they would work on the the newer version. And another thing - you can't simply copy my.cnf from to 3 to 5 and expect to work - a lot of things changed in there too. I got burned when moving from 5.0.10-something to 5.0.45 when some default values that were not in the configuration file were different in the higher version.
Aaand the last thing , if you use mysql replication, you can't have mysql 3.x slaves and mysql 4.x (not sure about 5) masters. The other way around is fine.

In my shop we like to think the database servers are "holy ground" and should be treated as such :)

share|improve this answer

Yes, the procedure is straight forward, just beware of old-passwords! 3.x and 5.x use a different password() function. So if you have tables that used the password(), you'll have to be aware of that. Try to use your platforms package install or a binary. Compiling is not for new users.

Make sure to back up all your databases with mysqldump AND make a copy of your /etc/my.cnf prior to the upgrade.

Also, make sure to read the documentation for the version of mysql you're upgrading to.

Finally, run *mysql_upgrade* when you're done.

share|improve this answer
1  
You can create a copy of your database (or virtualize the whole server), and try upgrading it virtually. If everything works fine, apply same changes to the production server. Cheers! –  kolypto Oct 23 '09 at 19:17
    
P2V is a great tactic for dicey upgrades, agreed. –  randy melder Oct 23 '09 at 20:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.