Community Documentation

Insert content into Drupal nodes

Last updated February 19, 2008. Created by ax on January 14, 2004.
Edited by puregin. Log in to edit this page.

The final trick is that the insert statements count on mysql's auto_increment feature, but drupal actually sets node ids explicitly. So after you run the generated mysql, you'll need to find the maximum node id that mysql generated for you, and bump the next node id that drupal intends to assign to be larger than that.

% /bin/perl ./convert.pl drupal.rdf >mt.sql
% mysql -ppassword drupal <mt.sql
% mysql -ppassword drupal
mysql> select max(nid) from node;
+----------+
| max(nid) |
+----------+
|       83 |
+----------+
1 row in set (0.25 sec)

mysql> select * from sequences;
+----------------+----+
| name           | id |
+----------------+----+
| users_uid      |  8 |
| vocabulary_vid |  2 |
| term_data_tid  |  8 |
| node_nid       |  6 |
| comments_cid   |  3 |
+----------------+----+
5 rows in set (0.00 sec)

mysql> update sequences set node_nid = 84;

Installation guide

Drupal’s online documentation is © 2000-2012 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License.
nobody click here