What I need is something similar to #516560: Doesn't bulk edit CCK fields with PHP. But instead of copying to CCK only, is there anyway I can copy from a CCK field to Body field?

I made a stupid mistake last two years to use cck field_text to store the main content instead of body field. Thus, I'm thinking of transferring the content to body field now.

Actually, Field Copy http://drupal.org/project/field_copy is pretty much the function that I want but I have 40,000 nodes need to copy to body field. My server does not have sufficient memory to perform the action on all the nodes in one batch.

Any one can help me out please?

Comments

infojunkie’s picture

Use the following PHP code with the action "Execute arbitrary PHP script":

$object->body = $object->field_text[0]['value'];
node_save($object);

Make sure to replace field_text with the actual machine name of your field, which you can find on the CCK manage fields page. Also make sure to set the VBO execution setting to "Use Batch API" to avoid timeout.

Hope that helps!

seakayjay’s picture

Status: Active » Closed (fixed)

That's Cool! it works like a charm. thank you so much, infojunkie. it helps me a lot.

zazinteractive’s picture

My nodes don't display the body field as a teaser after using this. What can I do?

stacysimpson’s picture

@zazinteractive, we ran into the same thing and had to set the following attributes as well.

$object->teaser
$object->format