I am converting a resource library to a drupal site and I need some advice on the best way to do this. In the current DB each resource has a number of fields, such as 'author', 'url', etc. Question now is the best way to port this over to drupal. I think the easiest way to convert this to drupal is to create a custom content type with the new functionality in 5.0
For example, I have defined a custom content type: resource
Added vocabularies: Author(s), URL, etc.
The problem is that I have a few thousand entries in this library and don't want to add them all manually. I can use php to pull out all the old info, but I don't know what tables I will need to update to make them show up as content. I can easily add them to "Nodes" but I'm not sure how to enter all the other data. Thanks!
I am using drupal 5.0
Comments
If you are familiar with
If you are familiar with PHP, I would suggest looking at wp2drupal or any of the other "3rd party import" style scripts and learn from them... Basically *ALL* data in Drupal goes into nodes and nodes_revisions (nodes tracks the latest revision and pertinent data on a node and that points to a revision id in node_revisions that contains the teaser and main data...)
I would think wp2drupal would be a good learning point for something like this.
-Karl
It would seem...
...that building a custom content type, then building a routine to move the data from the old database to the new one would be ideal. To order them, if you need some special order to the new nodes, you could export all the data via an ordering query to a csv file then run a php import. This could probably be done with an import query using a self-incrementing key. You would then be building a new custom table in the database, ending with the data just as you want it, including the new node number. Then a single query would put the data into the standard tables, to be displayed with your custom content type.
I think you mean a sql
I think you mean a sql import, not a php import. right?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Glenda: "Are you a good witch or a bad witch"
Katrina: " ... whatever ..."
katrinamessenger.com
Could be either...
Importing directly from the mySQL control panel would be the way I would start, probably, but if you wanted to massage the data to any degree, it might be easier in the long run to write a PHP routine that opened both databases, then processed the rows, making changes to the columns as you went. There are probably a lot of ways to do this, depending on what you want to do, exactly, and what tools you have available. The php route gives you a lot of control that is harder to build into a query.