Horrible mistakes sometimes give you new knowledge and insight. That’s what happened when I managed to install Drupal 6 over existing Drupal 5 database tables. I had put a lot of effort into recent work that wasn't yet backed up. Left with corrupt Drupal tables, I got to work.
When I say the table is currupt, I mean that Drupal would not load at all. It was basically a hybrid between a version 6 and 5 system and it wouldn't work. After backing up the broken database, I dropped all the tables and set up a fresh install. But trying to import the content again, I noticed that the structure of the
system tables didn't match.
What I ended up doing was to set up the system manually and importing the tables that actually did match. Luckily, all the content could be imported back. Drupal now loaded and ran fine until I wanted to add more nodes and instead got error messages like this one:
user warning: Duplicate entry '3-3' for key 1 query: INSERT INTO node (nid, vid, title, type, uid, status, created, changed, comment, promote, sticky) VALUES (3, 3, 'x', 'x', 1, 1, 1225794232, 1225794345, 2, 1, 0) in /x/includes/database.mysql.inc on line x.
The solution was in Drupal’s own documentation. It was merely a matter of editing the values in the
sequences table. After changing
node_nid to highest node ID in the
node table, it all went smoothly. The same goes for Views.