upgrade from karmic to lucid breaks drupal tables - some fields must be manually changed to autoincrement
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
drupal6 (Ubuntu) |
Triaged
|
Medium
|
Unassigned |
Bug Description
Binary package hint: drupal6
I upgraded my webserver from karmic to lucid and drupal got upgraded from 5 to 6.
Unfortunately, this broke my blog; I could still view stories and contents, but inserting new ones was problematic. I could create one new blog entry, but this got entered as nid=0. Subsequent entries also tried to insert as nid=0 and failed as a duplicate entry. Same thing with adding comments or users. For example:
user warning: Duplicate entry '0' for key 'PRIMARY' query: INSERT INTO users (name, mail, timezone, pass, init, status, created) VALUES ('nigelbabu', '<email address hidden>', 19800, '57faa81edaf93d
Error saving user account.
It turned out the problem was that the database tables after upgrade lacked the *id values as being set to autoincrement.
[Workaround]
select max(uid) from users;
> 368
alter table `users` AUTO_INCREMENT = 369;
alter table `users` change `uid` `uid` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT ;
Per the Drupal upgrade instructions, I believe if you hit the update.php script, this won't occur, as it will do any schema updates necessary for a major upgrade.
The appropriate thing would be for the drupal installation process to inform you, the user, of the need to do just that.
Marking Triaged as I believe a developer can add this message fairly easily.
Marking Medium, as this will affect anybody upgrading from karmic to lucid.