Hello,
Can any one has idea how to add a node into Drupal database directly without using drupal interface? I want to migrate large database into Drupal database and want to create large number of nodes.
What things need for this ? Can I use only SQL scripts only?
Thanks, Nikhil Kala Blogs - http://www.nikhilkala.com Cell : +91-9822602183 | GTalk - kale.nikhil@gmail.com | skype - nikhilkaleus
you might find this useful:
http://drupal.org/project/node_import
----- Original Message ----- From: "Nikhil Kala" writeme@nikhilkala.com To: support@drupal.org Sent: Friday, April 16, 2010 8:39 AM Subject: [support] How add a node into drupal database directly.
Hello,
Can any one has idea how to add a node into Drupal database directly without using drupal interface? I want to migrate large database into Drupal database and want to create large number of nodes.
What things need for this ? Can I use only SQL scripts only?
Thanks, Nikhil Kala Blogs - http://www.nikhilkala.com Cell : +91-9822602183 | GTalk - kale.nikhil@gmail.com | skype - nikhilkaleus
-- [ Drupal support list | http://lists.drupal.org/ ]
Hi nikhil,
This should help - http://lists.drupal.org/pipermail/development/2010-April/035397.html
Cheers Dipen
---------------------------------- Founder, QED42 : We build beautiful and scalable web strategies ( www.qed42.com ) Blog: dipenchaudhary.com Twitter: http://twitter.com/dipench
On Fri, Apr 16, 2010 at 6:01 PM, Neil Coghlan neil@esl-lounge.com wrote:
you might find this useful:
http://drupal.org/project/node_import
----- Original Message ----- From: "Nikhil Kala" writeme@nikhilkala.com To: support@drupal.org Sent: Friday, April 16, 2010 8:39 AM Subject: [support] How add a node into drupal database directly.
Hello,
Can any one has idea how to add a node into Drupal database directly without using drupal interface? I want to migrate large database into Drupal database and want to create large number of nodes.
What things need for this ? Can I use only SQL scripts only?
Thanks, Nikhil Kala Blogs - http://www.nikhilkala.com Cell : +91-9822602183 | GTalk - kale.nikhil@gmail.com | skype - nikhilkaleus
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
Here's a simple chunk of code for creating nodes. Hopefully it will help:
$nodeArray = array( 'type' => 'node_content_type', // Pick the content type you want the node to fall under 'status' => '1', // Published or not 'promote' => '0', // Promoted to front page or not 'comment' => '0', // Allow comments or not 'uid' => $user->uid, // User ID 'date' => format_date(time(), 'custom', 'Y-m-d H:i:s O'), );
node_validate($nodeArray); $node = node_submit($nodeArray); node_save($node);
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Nikhil Kala Sent: Friday, April 16, 2010 7:40 AM To: support@drupal.org Subject: [support] How add a node into drupal database directly.
Hello,
Can any one has idea how to add a node into Drupal database directly without using drupal interface? I want to migrate large database into Drupal database and want to create large number of nodes.
What things need for this ? Can I use only SQL scripts only?
Thanks, Nikhil Kala Blogs - http://www.nikhilkala.com Cell : +91-9822602183 | GTalk - kale.nikhil@gmail.com | skype - nikhilkaleus
Can any one has idea how to add a node into Drupal database directly without using drupal interface?
Here is the file I used to do the same thing. place it in your root dir, Then go to it like a web page. www.here.com/file.php.
A large number of files will make it time out, so you will have to check the last row inserted was, remove those from the list, save it, and run it again. Your hosting site might change the php time out setting for you.
You will need to set up a folder for your csv file to be, and a folder for a renamed copy to be saved.
After you are done, move the file off your server for security reasons. I am not sure if it could be use maliciously, but why take the chance.
The file is commented, hopefully very well. Email me if you have any questions.
This is modified code I got from Paul Couture that he demoed at the 2010 Nashville Drupal Camp. I hope you can get it to work for you.
Cory imaaxa@gmail.com