eAsylum.net Free Culture back up. (Trials and Tribulations of MySQL/Drupal)
Well, I have imported the majority of content over to eAsylum.net, which is now running Drupal version 4.5.2.
It ends up that the MySQL problem dealt with NULLs in the user table, which are no longer accepted in Drupal version 4.5.2's database. Thus, I was unable to login or run the update script, but I bypassed the requirement to be logged in to run the script (it's in the instructions in update.php), and I still couldn't log in.
The database looked fine and I backed that up - which was a mistake, because I backed it up over the Drupal 4.3.1 database. Duh.
And to fix the NULL problem, I replaced all NULLs with '0'. Happiness.
So the problem I then had was importing the content into the new database using SQL INSERT commands. No biggie, the MySQL dump had those - no problem!
Wrong. Somehow, over the versions, the *order* of the fields in the tables got changed - and not changed enough to generate errors in MySQL, but enough to reall FUBAR the content. This is sad, because in the node table, there are really no changes to be noted *except* the order. Or, at least with my backup that's what it looked like. And who cares about the order of fields in a table anyway? Well, someone who is backing up from a MySQL dump to a new database. Which, of course, it was never really designed to do...)
Doom on me.
But fear not! After experimentation and a few naps, I just dropped the entire database (again) and adapted the database creation script that comes with Drupal 4.5.2 to create the tables the way that the backup was created for the nodes - which means the content made it. So if you're caught in a pinch with an upgrade like that, save yourself some trouble and do this:
(1) Check if the field orders in the databases are different.
(2) Check if the fields in the database, including variable types and limits, are the same.
(3) If both (1) and (2) are true, then adapt the database script to create the tables from your dumped database (it's all in there) and the relevant INSERTs into the table (which will be below).
Now that disaster has been averted there... I can focus elsewhere... for a while.

Post new comment