If you have a Drupal 6 site, upgrading to Drupal 7 is quickly becoming a necessity. See our post Strategies on Upgrading Drupal. I've written this ouline:

  • To share our experience in upgrading a small Drupal site "in the wild",
  • To help Drupal 6 website owners understand what is involved in a D6 to D7 upgrade.

I wrote this document right after upgrading a small Drupal 6 site for the Brush School District. Larger, more complex sites will require more of everything that I outline below, but this is what I did for Brush Schools.

There are many resources available to assist you with this upgrade, e.g. http://drupal.org/documentation/upgrade/6/7 and many more. This post is merely documentation of my experience in this specific conversion.

Planning

With any major upgrade, planning is essential. Small or simple sites are typically straightforward to upgrade, but larger and more complex sites will require extensive research and planning.

We always develop an extensive planning document for larger sites. This document inventories contributed modules that do not have a clear upgrade path, any custom modules, conversion timelines and much more. 

I must say this, although it should be obvious: Don't perform the upgrade on your production site. Even for smaller sites. The upgrade is not turnkey, so you need a local or a development site. If you don't have one, you need to set one up.

When upgrading transactional sites or dynamic sites with changing content, minimizing downtime is imperative, but we can't convert the production database in advance without losing recent database changes. The client will need to publicize when the site will not be available and we, as the developers, need to assure that we have enough time to account for any potential problems. 

Scheduling site maintenance times can be tricky. For some sites, there is no good time to stop updates to the site. For most of our transactional sites, we are forced to schedule upgrades outside of normal business hours. Brochure site updates are always much easier; the general public doesn't often log in to the site to update the content. Conspicuous messages noting that the site cannot be upgraded are a necessity.

Fortunately, the Brush Schools site is updated by a handful of staff and the site's traffic is significantly lower through summer break. We can susped updates on the site for an afternoon during the summer so the database upgrade can be converted and updated long before the conversion date. Then, downtime for the site is almost nonexistant.

Backup Databases and Files

Once the planning phase is complete and you are ready to upgrade to Drupal 7, the first thing to do is to backup the database and files. In case of any errors or problems encountered during the upgrade process, you will be easily able to restore the original working version of the site. This step of the upgrade process should be completed for the production site, even if you have done the upgrade in a test environment a thousand times.

Remove Unused Modules

This is a good opportunity to uninstall and remove unused modules and directories after reviewing the upgrade path for contributed modules. This will help to reduce clutter and code that is no longer needed.

Prepare the Site for Upgrade

There are several steps needed in preparation for upgrading to Drupal 7. The most important is to update core and all modules to their latest version of the 6.x branch. This will ensure that the upgrade goes as smoothly as possible. In some cases, the upgrade path to Drupal 7 may not complete correctly if you are not using the latest version of the 6.x branch.

Prior to upgrading core, you will need to enable maintenance mode, remove the default.settings.php from the sites/default directory, switch the default theme to garland, and disable all contributed modules. Maintenance mode will tell a visitor the site is currently unavailable. The default.settings.php file will be replaced by the new version in the Drupal 7 upgrade package. Switching the default theme to garland and disabling all the contributed modules will provide an easier transition to the next version of Drupal.

Upgrade Core to Drupal 7

Finally! We are ready to upgrade to Drupal 7!

The first thing to do is remove all the files and directories, except for the sites directory. If you have custom changes to gitignore, htaccess, or robots.txt, make a backup of those files now. Make the settings.php writable so the upgrade process can make any necessary changes to the file.

Next, download Drupal 7 and place all the files inside of the web root folder for the site. Now, we are ready for Drupal to run the core upgrade path. Visit the settings.php when logged in as user 1, or use "drush updatedb" on the command line. This process can take some time, depending upon how many nodes are in the database. I recently upgraded a site with approximately one thousand nodes, and this process took around ten minutes to complete.

This would be a good time to backup the database and files so that you can return to this point of the upgrade process if you need to.

Upgrade CCK and Related Modules

The next step in the upgrade process is to migrate cck fields into the field api. To do this, we need to install the cck module for Drupal 7 and run the content migrate process.

Prior to running content migrate, we will want to review the messages display on the content migrate page and install any missing modules, such as Date, Link, References, etc.

Once ready, we can run the cck content migrate process. When the process is complete, check for any problems encountered. If necessary, any of the listed field changes can be rolled back and reapplied.

This might be a good point in the process to run another database and files backup.

Upgrade Contributed Modules

Now, we are ready to upgrade all the contributed modules to their Drupal 7 counterpart. I can't recommend updating all modules at once. I like to update no more than a few modules at a time so I can identify any problems encountered with the upgrade path for specific modules. If upgrading all at once, you could potentially get lost in a sea of errors. Make sure to run update.php on each upgrade since each module will need to run their own upgrade path code.

Upgrade the Theme

The theme being used from Drupal 6 will need to be upgraded to work with Drupal 7. This part of the process shouldn’t be too time consuming, unless there are many template files that need to be upgraded. For the most part, upgrading a theme to Drupal 7 is straightforward: Drupal.org - Converting 6.x Themes to 7.x

Upgrade Custom Modules

If the site has any custom modules, those will need to be upgraded to use the latest api functionality. The time to upgrade a custom module can vary based upon size and complexity: Drupal.org - Upgrading Custom Modules

Last Steps and Additional Considerations

Once the upgrade process is complete, run a status report from the reports menu and correct any problems encountered and disable maintenance mode. The last step is to go through all pages and applications and test everything. If any theming or functional issues are encountered, now is the time to correct those.

Scope Creep

Like all Drupal projects, watch for scope creep. "This page has always appeared like <fill in the blank>, but that was never right. Please fix it." Building in time in the budget to handle scope creep is always wise, but you will want to identify scope creep to the client and define the impact on the conversion's timeline and cost.