Upgrading this site from Drupal 7 alpha 6 to beta 1

tanc's picture

After a fair bit of searching in issue queues I discovered the head2head module. This also includes a module called alpha2alpha which makes upgrading between alpha version easier. As I was on Drupal 7 alpha 6 I needed to install alpha2alpha and run update.php to let alpha2alpha upgrade the database for alpha 7. Using git I created a new branch for alpha 7 and checked it out. I upgraded Drupal core to alpha 7 after the database update was done. All good so far.

I then created a new branch for beta, checked it out and again upgraded core to beta 1. Alpha2alpha didn’t have the required code to handle the beta upgrade so I found a patch for head2head with the necessary code. Unfortunately I couldn’t run it at this point as my Drupal site was broken, so I decided to manually apply the database changes. Using Sequal Pro I added the two new fields to the node_type table following the schema defined in the head2head function below:

function head2head_895014() {
  db_add_field('node_type', 'module', array(
    'description' => 'The module defining this node type.',
    'type' => 'varchar',
    'default' => '',
    'length' => 255,
    'not null' => TRUE,

  db_add_field('node_type', 'disabled', array(
    'description' => 'A boolean indicating whether the node type is disabled.',
    'type' => 'int',
    'not null' => TRUE,
    'default' => 0,
    'size' => 'tiny'

This fixed the first error but another showed up so I applied the following manually:

function head2head_914458() {
  // Add the new {filter_format}.status column.
  db_add_field('filter_format', 'status', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 1,
    'size' => 'tiny',
    'description' => 'The status of the text format. (1 = enabled, 0 = disabled)',
  // Drop simple weight index and add status_weight combined index.
  db_drop_index('filter_format', 'weight');
  db_add_index('filter_format', 'status_weight', array('status', 'weight'));

Once that was done everything seemed fine. Just merged back my changes to Master and tested.

The only other thing that was broken was the linkage between my tags vocabulary and the field entity. Rather than figure out how to fix this I decided to delete the field and its data and recreate it.

Thanks to the head2head module developers for keeping track of schema changes and providing the means to update.