Migrating to Drupal 7

Yesterday I realised that this blog is close to 9 years old. I think its first version was based on Drupal 4.x and I remember I kept it installed in my own Linux server at my shared flat room under a 'homelinux.org' subdomain.

After attending Barcelona Drupal Devdays, where many of the talks debated about the upcoming features of Drupal 8, I thought it was time to upgrade my rusty Drupal 6 website to current stable version, Drupal 7. Since soon or later I must upgrade a couple of other Drupal 6 websites, I considered it was worth trying it first in my own personal weblog.

Below I detail some of the problems and difficulties I encountered during the update process. I imagine most of the stuff is related to the fact I've been upgrading for such a long time and because of using certain extensions. Anyway, I hope this can be helpful to other people.

IMPORTANT: I performed the following fixes sequentially as the update process got stuck and I had to find out what went wrong.

  • Delete old image module reference from {system} table: delete from system where filename='modules/image/image.module'; (I think I didn't use that module in Drupal 6, but in previous versions, and now it's actually a default one in Drupal 7
  • Rename profiles folder for a while, and rename back again after the error was overcome — http://drupal.org/node/1007038
  • Run manually ALTER TABLE system CHANGE `bootstrap` `bootstrap` INT NOT NULL DEFAULT 0;
  • Because a few update steps took too long, connection got lost and some processes stopped as they were still going on. Therefore I had to drop certain tables, and force the process to restart and create again their tables. That's the example of node.module Update #7006 (below the error).
Failed: DatabaseSchemaObjectExistsException: Table <em
class="placeholder">field_data_body</em> already exists. in
DatabaseSchema->createTable() (line 657 of
/../includes/database/schema.inc).
  • One module, xmlsitemap, didn't have enough update history steps and, as I didn't want to go back to Drupal 6, I had to force a clean new installation of the module. This meant removing xmlsitemap tables and xmlsitemap entries in {system} table. Of course, this implied to lose all relevant data of that module, but it was not a big deal in the end.
 As you can see, I still need to prepare a proper theme (now base HTML5 Zen). But well, at least I got rid of the previous embarrassing table-based one.