I will be upgrading a large database (9GB) from MySQL 4.1 to MySQL 5.1. I have 2 options (that I know of). Which is the better option and why?
- Dump entire DB using mysqldump, upgrade the server, then import the mysqldump file. This ensures that the tables are in the new 5.1 format.
- Use the same table files on the new server, but update them using "REPAIR TABLE" command. Not sure about this method's reliability.
All tables are MyISAM.
Option 1. Not only is it the safest, it also ensures you have a backup in case it all goes pear shaped. With 9GB, depending on schema(s) used, I would probably be inclined to dump each database and possibly even each table to a separate dump file.
Option 2 leaves too much room for things to go wrong.
Try both! But be sure to have a backup copy of all files so you easily can roll back if you destroy something. Try it on a test server first.
In My Opinion Method 1 is the safest and fastest.
Method 1.
Here's why. At my company we upgraded from MySQL 4.1 -> 5.1. We had ALOT of databases that became corrupt and the repair table command would not repair the table. The only thing we could do was zip up the databases, move them to another server running 4.1 and repair them, than dump and import into new databases on 5.1.
Method 1. Definitely.