We built an application for a client of ours to track appeals and cases of a legal case. There are currently over 2,000 entries in the system. After we built the app, it was requested we add four more fields for allocation amounts. We added the fields, but he would like to now import the content (which he has already put in a csv format, in proper order for an import).

We originally used Node Import module to import all of the content (I believe 1700 of the 2000 entries were entered through the initial import). However now that we have added extra fields, Node import does not have functionality to import into empty fields, mainly I believe because it does not have the ability to identiy unique identifiers and see that an entry already exists for that Node title.

Node Import Update module, from what I read in the description of the module should be able to do it. However after installing this module and doing the import again, it does not work, instead it creates duplicative entries.

In Node Import Update module's known issues page (http://drupal.org/node/813978), it says one needs to go in and update the node type you want to import. I do not know what value it is asking for here. The name of the Content Type in which the fields are in? This is what I currently have it set to. I know Title is correct - not sure about the node type:

Set custom data * These should/could be defined in admin * */ // Node title as unique identifier //$IMPORT_UNIQUE_ID_NAME = 'title'; // Import field that holds the unique identifier //$IMPORT_UNIQUE_ID_IS_CCK = FALSE; // Is the identifier a CCK field?

// CCK field as unique identifier
$IMPORT_UNIQUE_ID_NAME   = 'title';  // Import field that holds the unique identifier
$IMPORT_UNIQUE_ID_IS_CCK = FALSE;    // Is the identifier a CCK field?

$IMPORT_NTYPE            = 'node';   // Node type to be imported
$IMPORT_UPDATE_DATETIME  = TRUE;        // Settting: update date/time value?

Sorry if it is long winded - however I wanted to ensure I was complete in describing the issue as I really need to get this wrapped up for my client. Thanks!!!


3 Answers 3


I'm pretty sure you'll be happy with the excellent Feeds module, which does this every day for thousands of sites. More advanced/customizable techniques are available with Migrate module, which always requires code, but gives enormous flexibility. Both will allow you to update existing nodes. Had you used them for your initial import, you'd be done now. I think you still may be able to use them as long as you have a unique identifier on your existing nodes.

  • I am trying to use feeds module to update existing nodes but it required GUID and I do not see GUID as part of existing nodes, thus how can we identify existing nodes so feeds updates nodes instead of trying to create new nodes?
    – pal4life
    Commented May 30, 2014 at 16:10

I'd suggest some custom code that does a SQL UPDATE to your node entries based on the unique ID, in your case the "title" field. I suspect your case is too specific for a general community contributed module. This is not a large task provided you know where to poke. Please post your solution if you get this working.


I have faced a similar situation before, it was in Drupal 8 though and i managed to resolve it by running this script on /devel/php. I was appending application numbers on records after they were created. Not exactly what you were looking for but I hope this will be helpful to someone in need.

#Script to be run to patch application numbers on applications
use Drupal\node\Entity\Node;
use Drupal\webform\Entity\Webform;
use Drupal\webform\Entity\WebformSubmission;
use Drupal\webform\WebformSubmissionForm;
use Drupal\Core\Database\Database;

$entityStorage = \Drupal::entityTypeManager()->getStorage('node');
$query = $entityStorage->getQuery();
$query->condition('type', 're_sponsorship_appl_processing');
$nids = $query->execute();
$nodes = $entityStorage->loadMultiple($nids);

foreach ($nodes as $node) {
    #append the data to the fields here 
        $conn = Database::getConnection();
        $query = $conn->select('appldtefRe_sponsorship', 'a')
        ->condition('a.submissions', $node->get('field_progression_appl_submissio')->target_id, '=')
        ->fields('a', ['serial']);
        $result = $query->execute();
        foreach ($result as $record) {
            #only one record will be returned here, save number to variable
            $appl_postfix = $record->serial;
            $app_num = "SR/2022/" . str_pad($appl_postfix, 6, "0", STR_PAD_LEFT);
            $node->set('field_application_number_c', $app_num);
    } catch(Exception $ex){
        \Drupal::logger('test submission')->error($ex->getMessage());

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.