Upgrading with Feeds

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
mollyavalon's picture

At the last meetup in KC, at the very end as the meeting was breaking up, several people mentioned that Feeds works as a way to upgrade a site from D6 to D7. I was unable to make it work. Have any of you actually done it, or is your knowledge theoretical? Documentation is thin on this topic, and I would very much like to make it more helpful.

Comments

spotty

BenStallings's picture

My experience with Feeds is that it's a good start for an import, because it handles the tricky business of revisions. (If you import manually into a table that has a corresponding revision table, each table has an auto-increment key and a unique index on the other table's key, which means you can't insert data into either one before the other without resorting to tricks such as temporarily deleting the index or using out-of-sequence ID numbers.)

Feeds is not, however, a reliable way to import fields in my experience. It makes mistakes, sometimes inexplicable and unforgivable ones such as putting the value of one field into a different field when it was clearly told to do it properly. What it does do reliably is to generate blank entries in all the field tables (and their corresponding revision tables) to go with the node entries, which you can then easily update manually in the database. So here's what I would recommend:

1) Make a copy of the site and use the actual upgrade procedure to upgrade most of the data. CCK module for D7 does a great job of upgrading most CCK fields to Field API.

2) Finish configuring the Drupal 7 site. This can take several weeks, depending on the complexity of the site!

3) Take the D6 site offline and use Feeds to import any content (users, nodes, taxonomy) that has changed since step 1. Instead of trying to import all the fields, import only one or two simple fields that will allow you to match the new D7 entities with their D6 counterparts. (the URL path works well for this, if your node titles are not unique.) Note that before you can import, you will have to export the relevant data from the D6 database.

4) Use direct database queries to import the field data from D6, using the matching field(s) you already imported.

I'm sure there are more professional ways, but this is what has worked for me.

a note about old tables

BenStallings's picture

Note that when the CCK module upgrades your data to Field API, it leaves behind the old CCK tables in the database, just in case you might need them. When you do your manual import, you'll be updating the data in the new Field API tables (field_data_field_fieldname and field_revision_field_fieldname), not the old CCK ones (content_field_fieldname). I found it was less confusing to drop the old content_* fields from the D7 database before starting my update queries.

Thanks, Ben. Are you in the

mollyavalon's picture

Thanks, Ben. Are you in the KC/Lawrence area? Can you come talk about this with us on Feb. 7?

I'm in Emporia...

BenStallings's picture

I'm in Emporia, so KC/Lawrence is kind of a hike. Maybe if someone offered to buy me dinner... ;-) I'll sign up tentatively for now, pending details of the meeting. Lawrence would work better for me than KC, if you haven't settled on a location yet.

Kansas City

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week