(Tips) Use MySQL to double the nodes in your Drupal database
Tips : Use MySQL to double the nodes in your Drupal database
Now as a shell script. You may have to update the MySQL user in the script. A file version of the script is attached. Download it, make it executable with chmod +x ./doublenodes, and then run it with ./doublenodes databasename
#!/bin/sh
mysql -u root -p -e "
INSERT INTO node (nid, vid) VALUES (NULL, -1);
SET @nid:= (SELECT MAX(nid) FROM node);
DELETE FROM node WHERE nid=@nid;
INSERT INTO node_revision (nid, vid) VALUES (@nid, '');
SET @vid:= (SELECT MAX(vid) FROM node_revision);
DELETE FROM node_revision WHERE vid=@vid;
INSERT INTO node
SELECT
NULL, @vid:=@vid+1,
type, language, title, uid, status, created, changed, comment, promote,
moderate, sticky, tnid, translate
FROM node;
INSERT INTO node_revision
SELECT
@nid:=@nid+1, NULL,
uid, title, body, teaser, log, timestamp, format
FROM node_revision;" $1
Courtesy:- robshouse.net
- guru's blog
- Login to post comments
![Drupal-6-Book-[Building Powerful and Robust Websites with Drupal 6].jpg](http://www.drupalranch.com/images/Drupal-6-Book-[Building%20Powerful%20and%20Robust%20Websites%20with%20Drupal%206].jpg)