Migrating my old mysql blog database to a new blog software (PluggedOut)

We updated my server from SuSE 9.3 to 10.1. php5 is the default on 10.1 and my blog software broke. As my blog software is not anymore maintained, I had to switch to another and I selected PluggedOut. The mysql database structures were quite different and this is what I did to do the conversion:

First I dumped the old database into textfiles:

mysqldump -u root -p --tab=/home/jeltsch/temp --fields-terminated-by=| --lines-terminated-by=# journal

Then I opened the textfiles in a spreadsheet application and added the necessary columns and fixed the formats. Then I exported into a csv file and imported back into the new database:

mysql -u root -p pluggedout
mysql> DELETE FROM blog2_entries;
mysql> OPTIMIZE TABLE blog2_entries;
mysql> WARNINGS;
mysql> LOAD DATA INFILE '/home/jeltsch/export.csv' INTO TABLE blog2_entries FIELDS TERMINATED BY ',';

The WARNINGS command shows you when there are problems. Mostly they were related to the field delimiter (comma). I had to escape all commas, that were not field delimiters (,). I also needed to fix the date format (swap month and day). Since the categories were maintained in a separate table, I recreated a csv file by hand and set all entries to belong to the category "computer". This .csv file was pretty simple:

1,1,2
2,2,2
3,3,2
4,4,2
etc.

mysql> DELETE FROM blog2_entry_categories;
mysql> OPTIMIZE TABLE blog2_entry_categories;
mysql> LOAD DATA INFILE '/home/jeltsch/cat.csv' INTO TABLE blog2_entry_categories FIELDS TERMINATED BY ',';