Upgrading BeFused from Drupal 5 to 7
I have a confession to make. This site runs on Drupal 5! Back in its day, Drupal 5 was a great system. But it a far cry from what Drupal 7 now offers. I have plenty of experience upgrading sites from Drupal 5 to Drupal 6, but I want to take this all the way to Drupal 7.
I have 2 main options:
- Follow the upgrade path
- Rebuild in Drupal 7 and migrate the data
If it were a Drupal 5 to 6, or Drupal 6 to 7 upgrade, I could normally recommend the first option. This is especially true if you want the site design and features to be status quo.
However, in this case, I want to rebuild the site anyway, because I built this site around 5 years ago and have made mistakes that I won't repeat. This is a good opportunity to start afresh. Also, a Drupal 5 to 7 upgrade would involve 2 upgrades - 5 to 6 and then 6 to 7. It is not a very complicated site (mainly just a blog), so the data migration should be fairly straight forward.
So for this one, I am going to take the second option and rebuild and migrate.
Migrating the data
I have a few options for migrating the data.
The Migrate module is designed to migrate data from other sources into Drupal. For example, migrating from another CMS to Drupal. However, it should be very useful for a Drupal to Drupal migration as well.
Node Import will import content from a CSV file and you can map to content type fields, taxonomy and users. So I could export content from this site as CSV and then use Node Import to import to the Drupal 7 site.
The Feeds module imports content from a feed (RSS, Atom etc) and creates nodes, users and taxonomy terms. It also supports CSV, so has some overlap with Node Import. It is aimed more at aggregating content from other sites/sources on a regular basis, but can equally be used for a one off migration.
I could write a PHP script, or Drupal module, to grab the content from the Drupal 5 database, and then connect to the Drupal 7 database and insert it. If it were a Drupal 6 to 7 migration, I could use the Batch API to prevent PHP timeouts. However, the Batch API is not available in Drupal 5.
Once the rebuild and migration is complete, I will write another post to outline the migration approach that I took and a tutorial on how to do it.
If you liked this, you'll love my book, Master Drupal Module Development.
"..the must have drupal developers book"
Feeling stuck with Drupal 8 module dev?
Get the free 7 lesson course that will help you get started today without feeling overwhelmed.
- Create Drupal modules with just a few commands using the Drupal Console
- Create custom pages
- Create custom blocks
- Create admin forms
- Demystify routers and controllers
- Bonus material