Upgrade from D6 to D7 (the easy way)

It's time to talk about upgrading from Drupal 6 to Drupal 7 since Drupal 8 is just at the front door. 

Condition: there is no custom modules that is messing around the fields, the nodes and the db. (We will need to uninstall them anyway) 

OK Let's start upgrading:

  1. Have the prod drupal 6 db and site working in your dev site.
  2. Disable all contrib modules and your custom modules.
  3. Change the theme to Garland.
  4. Set the site offline in site maintenance.
  5. drush up to 6.31 / copy d6.31 files to the codebase and run update.php. (Currently the latest d6 version is 6.31, you may need to upgrade to another version when you read this)
  6. I guess it is time to mysqldump the db.
  7. Download the latest D7 version.
  8. Copy everything (don't forget the .htaccess file) except the sites folder in the drupal-7.xx directory to your site root.
  9. Delete the include/database.inc file.
  10. drush updatedb or run update.php.
  11. Go to your database, run update block set visibility = 1 where module = 'system' and delta = 'main'. Then your content block should be showing.
  12. drush cc all.
  13. Now your core should be in D7, let's dump the db.
  14. Change the theme to Bartik and the admin theme to Seven.

When you finish upgrading, you may find your cck fields have all gone, don't panic:

  1. Install cck d7 module.
  2. Install/enable email, file, list, number, viewfield D7 modules.
  3. Dump the db just in case.
  4. Visit admin/structure/content_migrate.
  5. Click ‘migrate selected fields.

Your fields should be back now. Happy? not quite finish yet:

  1. Install features module, create the feature for your d7 site. 
  2. Put the codebase back to your prod server.
  3. Export and import the db to your prod server.

Now you should be happy. Then you can go find a d7 module to port to d8 ......