Drupal 5.1 to 6.6: import Nodes + Taxonomy

no2e - December 7, 2008 - 02:49

Situation

  • Installation A: Drupal 5.1
  • Installation B: Drupal 6.6 (fresh install, no content)

There is only one author in both installations: the user 1 (admin).

What I want to do

I want to import all nodes (all of the same one Content Type) of installation A into installation B. The nodes are tagged with terms of several vocabularies. I want to import these vocabularies + terms, too. And the connection of terms to nodes shall not be lost.

What I don't need want

I'm not interested in all the other stuff like settings, paths, uploads or modules. I want to restart freshly with the 6.6 installation and only need & only want the pure nodes and the connection nodes <-> terms.

About the content type

As I said, all the nodes I want to import are of the same CCK Content Type.

It consists of the following CCK fields:

  • Image (1)
  • Text (1)
  • Link (1) (consisting of several links)

and the standard fields:

  • title
  • body_filter
  • taxonomy (7 categories)

I absolute need the title and the text field + the annotated taxonomy terms. I don't need the image, the link(s) and the body. If necessary [anhören], I could delete all the unneeded stuff at my 5.1 installation (but I'd like to keep it for the data loss case).

How?

I browsed through the export/import modules and drilled them down to 2 modules, which seem to be related to my plans and are available for Drupal 5 and 6:

Are there any other modules, which could be useful or are needed? Is my wish possible? Any advice?

Conversion could still work

peterx - December 7, 2008 - 05:44

You could copy the old site as the new site then convert from 5.1 to 6.6 then delete everything you do not want. You could also convert the old 5.1 site to 6.6 then copy the node and taxonomy tables to the new site. Working on two sites at the same release could be easier than trying to both convert up a release and selectively copy information in one hit.

petermoulding.com/web_architect

You could copy the old site

no2e - December 7, 2008 - 06:09

You could copy the old site as the new site then convert from 5.1 to 6.6 [...]

I think, this it not possible in my case, because I use a multisite setup (6.6) - so I can't start with a fresh 5.1.

You could also convert the old 5.1 site to 6.6 then copy the node and taxonomy tables to the new site.

What does it exactly mean to "copy the node and taxonomy tables"? Do you mean via phpMyAdmin? Is it an "easy" task (because I don't know anything about tables/databases)?

Forget the option to copy tables

peterx - December 7, 2008 - 07:09

Copying tables using phpmyAdmin is not difficult but deciding which tables you should copy is a challenge. If you are not used to working with Drupal at the table level, then copying tables is dangerous.

You also mention multisite. If you have other sites active then table copies run into id problems. Suppose your old site has nodes from 1 to 99 and your new site already uses nodes 1 to 37, you would have to renumber old node 1 to 38 and old node 2 to 39, through to old node 99 becoming 136. Any table that references the nodes would have to reference the new id. The id problem would not exist if the new site was completely empty.

A node is stored as two tables, a node table identifying the nodes, and a revision table containing revisions to content. Node 5 might have a revision with an id of 8. CCK adds five new tables that are exampled somewhere and their ids are even more complex. Exporting the information is easy. When the information is imported, something has to understand all the relationships between tables and convert the ids. The task is harder if the table structure has changed across the releases.

The ideal way would be to export nodes by name then insert the information into the new site using Drupal functions. To do that, you need export and import functions that understand Drupal. You use CCK which means you need something that understands Drupal and CCK. Perhaps you could look in the CCK module issues list to see if anyone has asked for an export feature.

petermoulding.com/web_architect

Hello no2e, I'm wondering how

jbfp - May 11, 2009 - 18:52

Hello no2e,

I'm wondering how your upgrade and data importing went. I'm in a very similar situation and it looks like the Node Export module won't export my customized content types. Were you successful in exporting CCK fields? And when you moved everything to the new installation, did the nodes keep their taxonomy terms?

Jessica

I have not tackled this

no2e - May 11, 2009 - 22:40

I have not tackled this import yet - several higher priority projects are in my stack atm.
But I still want to finish it.

Subscribing, still interested

Summit - November 3, 2009 - 15:16

Subscribing, still interested in export from D5 to import in D6! Greetings, Martijn

Greetings,
Martijn
if you appreciate e-development work, please place a link from your site to www.trekking-world.com

 
 

Drupal is a registered trademark of Dries Buytaert.