Drupal 6 to Drupal 7 Migration step 4 - Drupal 6 contrib major version update

| | 3 min read

After the core update, the site will definitely be malfunctioning as expected, as long as it isn't WSOD, you're fine! Ignore it and move forward with the migration process. If you were using a custom theme, then in all probability your site will appear broken because your theme was designed for Drupal 6 and the core is now Drupal 7. If you were using custom or contrib modules to display content or blocks the same would happen because the modules are disabled and still Drupal 6.

Firstly change the default theme and admin theme to a Drupal 7 compatible one. Garland does not heed well with Drupal 7 while upgrading from Drupal 6. So change default theme to bartik and admin theme to seven. After the migration process has been completed, change the themes to your choice. Using drush run the following commands to do the same :

drush vset theme_default bartik 
drush vset admin_theme seven

Again, backup your code and database before you download all the available contrib modules to the sites/all/modules folder. It is good practice to separate custom and contrib modules in their respective folders. After that, download all the available contrib modules and paste into the sites/all/modules/contrib folder. The easiest way to download the modules is to run

drush dl -y MODULE_1 MODULE_2 MODULE_3 ... MODULE_N

The list of modules can be taken from the spreadsheet created in the first step.

Once all the modules have been downloaded and copied, run update.php. This will update the database for all modules. There are some known issues for some modules that stop the update process. If you are using ubercart, updating it requires a few extra steps. The most common error is of the type :

An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: http://website.local/update.php?op=selection&token=-wj2b0eR73ZFEVxx23OsbbV0xb2YeVPBRW0ZnQ2jTnQ&id=15098&op=do StatusText: OK ResponseText: Fatal error: Call to undefined function in /home/user/Projects/website/web/sites/all/modules/ubercart/uc_taxes/uc_taxes.install on line ##

There are a few steps you must follow to work around this issue :

  • Run update.php again. This will show that the number of updates remaining has reduced. Repeatedly run update.php until the remaining updates number is constant.
  • Some modules may require their sub modules to be enabled, to complete updating. If such a module is used in your site, one of two things can be done.
    1. Remove the code of the module(s) causing the error and update the rest. Then, after enabling the rest of the modules or the sub modules necessary, run update.php again. This can be done after the entire update process is completed.
    2. Or, you can update the code to a version that does not throw this error. For example, you have updates 7001 to 7014 and update 7007 is throwing the error. Then update the module(s) to that version where the update 7007 is not there. In short, download an older version and run update.php.
  • Ubercart is one module that has this type of a problem. This is because many modules that were in the package ubercart - extra, is now in the ubercart core. So what I did was, updated all the other modules and then downloaded ubercart and ran update.php again and again until the updates were a constant (as mentioned before) and then enabled uc_order, uc_cart and uc_product. The error was thrown by uc_taxes module which was solved after enabling these modules.

Since you have migrated from the old site, old data in the database may show warnings of the form :

Notice: unserialize(): Error at offset 12 of 13 bytes in variable_initialize() (line 936 of /home/user/Projects/zyxware/web/includes/bootstrap.inc). 
Notice: unserialize(): Error at offset 12 of 13 bytes in variable_initialize() (line 936 of /home/user/Projects/zyxware/web/includes/bootstrap.inc).

The above means you have bad data in the variables table. Use the mysql command line to delete the tables from the database. Now, to complete the migration process you have to update the custom modules and content.