Hi,

I have a very large database of information and files I would like to import into drupal as nodes. I installed and setup CCK, created a content type just as I want it, featuring all of the fields I need to populate:

Title
Taxonomy - (Fixed Categories)
Body
Thumbnail (CCK Image)
Flash (CCK Filefield/FlashField)
Instructions (CCK Multitext)

I have extensive experience developing modules for 5.x but have just made the leap to 6.x. I found a thread about programatically creating regular nodes in 6.x ( http://drupal.org/node/243950#comment-965380 ) but that method doesn't seem to work for CCK fields - unless I'm missing something. The CCK database tables seem very complex - especially for the file upload fields.

Could you please show me what needs to be done?

Thank you

Comments

mstef’s picture

I just came across Node Import - perhaps that is just the easiest way to do it and leave the hard-coding out of it?

andreiashu’s picture

First try Node Import as mikestefff suggested. If it does not suit your needs you can have a look at Node Factory
About the ability to add files here is a detailed article about this: http://current.workingdirectory.net/posts/2009/attach-file-to-node-drupal-6/

Please post back with the solutions found for your needs. It could help other ppl too :)
Good luck,
andreiashu

Edit: just now I saw that you commented to your own post :)

mstef’s picture

Haha yea that was me. Node Import was pretty amazing to my surprise. Took a little while to get some of the kinks out but it worked perfectly. Just had to reformat my data accordingly but that was easy with a few lines of PHP.