Simple Node Importer

A Drupal module that allows end users to import content entities (nodes, users, taxonomy terms) from CSV files without development knowledge.

simple_node_importer
216 sites
6
drupal.org

Overview

Simple Node Importer provides a user-friendly interface for importing content into Drupal from CSV files. End users can upload CSV files, map columns to entity fields using a flexible mapping UI, and import data in bulk. The module supports importing nodes of any content type, users, and taxonomy terms.

When import failures occur, the module provides a Resolution Center where users can view failed records, understand the reason for failure, and resolve issues directly. The module tracks all import operations and allows downloading failed records as CSV for correction.

Key capabilities include automatic field detection, support for multivalued fields, entity reference handling (taxonomy terms, users), automatic user creation options, and taxonomy term auto-creation.

Features

  • Import entities (nodes, users, taxonomy terms) from CSV files with a simple upload interface
  • Flexible Mapping UI that allows mapping CSV columns to entity fields with visual feedback
  • Resolution Center for tracking and resolving failed import records with edit and save functionality
  • Download sample CSV template files based on selected content type fields
  • Support for multivalued fields by mapping multiple CSV columns to a single field
  • Automatic user creation options when author specified in CSV doesn't exist in the system
  • Automatic taxonomy term creation when terms don't exist in referenced vocabularies
  • Batch processing for large imports with progress tracking
  • Import status tracking showing successful and failed record counts
  • Download failed records as CSV for external correction and re-import

Use Cases

Bulk Node Import from CSV

A content administrator needs to import 500 articles from a legacy system. They export the legacy data to CSV with columns matching the article fields (title, body, author email, category). Using Simple Node Importer, they select 'node' entity type and 'article' content type, upload the CSV, and use the mapping UI to connect CSV columns to Drupal fields. The batch process imports all articles, creating nodes with proper field values and author attribution.

User Migration

An organization is migrating from another platform and needs to import 1000 user accounts. They prepare a CSV with username, email, and status columns. After selecting 'user' entity type, they map the CSV columns to user fields. The import creates user accounts, with the Resolution Center allowing them to fix any records that failed validation (duplicate emails, invalid formats).

Taxonomy Term Hierarchy Import

A site administrator needs to create a complex category taxonomy with parent-child relationships. They prepare a CSV with columns for vocabulary name, parent term, and child terms. The taxonomy import creates the vocabulary if needed and establishes the term hierarchy automatically.

Handling Failed Imports

After importing 200 nodes, 15 records failed due to invalid date formats and missing required fields. The administrator visits the Resolution Center, views the failed records, and clicks 'Edit & Save' on each to open a pre-populated node form showing exactly which fields had issues. They correct the data and save, updating the Resolution Center status automatically.

Content Type Field Template

A content editor is unsure what columns their CSV needs for importing events. They navigate to the import page, select 'node' and the 'event' content type, then click 'Download Sample File'. This generates a CSV with headers matching all event fields (title, date, location, description), which they can fill in and upload.

Tips

  • Always download and review the sample CSV template before preparing your import data to ensure column names match expected fields
  • Use the Resolution Center's 'Download CSV' feature to get failed records, fix them externally, and re-import in a new operation
  • For large imports, consider breaking data into smaller CSV files to make troubleshooting easier
  • Entity reference fields (user, taxonomy) should contain values that can be matched - email for users, term names for taxonomy
  • Boolean fields accept 'y', '1', or 'TRUE' for true values and 'n', '0', or 'FALSE' for false values
  • The module creates a custom content type 'simple_node' for tracking imports - don't delete these nodes until import is complete

Technical Details

Admin Pages 5
Simple Node Import Settings /admin/config/development/snodeimport

Main configuration page for Simple Node Importer. Administrators can configure which entity types and content types are available for import, set user auto-creation behavior, and manage taxonomy term settings.

Resolution Center /nodeimporter/resolution-center

Displays a table of all import operations with failed records. Users can view the success/failure counts, download failed records as CSV, view individual failed records, or delete import logs.

Create Import /node/add/simple_node

Interface for creating a new import operation. Users select the entity type, content type (for nodes), and upload a CSV file containing the data to import.

Field Mapping /nodeimport/{content_type}/{node}/mapping

Flexible mapping interface where users map CSV columns to content type fields. Shows all available fields from the selected content type and allows selecting corresponding CSV columns.

Confirm Content Import /nodeimport/{content_type}/{node}/importing

Confirmation page before starting the import batch process. Displays important information about author handling and asks for final confirmation.

Permissions 4
Admin access Simple Node Importer Dashboard page

Grants full administrative access to all Simple Node Importer functionality including settings, mapping, importing, and resolution center.

Access Simple Importer settings page

Allows access to the module configuration settings page.

Access Simple Node Import

Basic permission to use the Simple Node Importer functionality.

Access Simple Importer manage uploads page

Allows access to manage uploaded CSV files and import operations.

Hooks 4
hook_form_alter

Alters the simple_node node form to add AJAX callbacks for entity type selection, field visibility states, CSV upload handling, and validation. Also alters the target entity forms when resolving failed imports to pre-populate fields.

hook_node_presave

Sets automatic title for simple_node content type based on selected content type and creation date.

hook_theme

Defines theme hooks for the mapping UI table, content info note, and mapping help text.

hook_help

Provides help text for the module's help page explaining features and usage.

Troubleshooting 7
No entity types available in import form

Navigate to /admin/config/development/snodeimport and enable at least one entity type (node, user, or taxonomy) in the Entity Type Settings section.

Content type not appearing in selection dropdown

The content type must be enabled in module settings. Go to /admin/config/development/snodeimport and check the desired content type in Content Type Settings.

Author field causing import failures

The author field expects email addresses that match existing users. Enable user auto-creation in settings, or ensure all email addresses in the CSV correspond to existing user accounts.

Taxonomy reference field failing

Check that the taxonomy term exists in the correct vocabulary. Enable 'Allow adding new taxonomy terms' in settings if terms should be created automatically.

Date fields not importing correctly

Use standard date formats like 'Y-m-d' or 'Y-m-d H:i:s'. Check the mapping help text for allowed formats specific to your datetime field configuration.

Multivalued fields not importing all values

Each value for a multivalued field must be in a separate CSV column. On the mapping page, select all relevant columns for that field (the dropdown allows multiple selection).

Cannot resubmit an import node

Import nodes are one-time use. If you need to re-import, create a new import node by going to /node/add/simple_node.

Security Notes 5
  • The module requires specific permissions for import operations - ensure only trusted users have 'admin access simple_node_importer' permission
  • CSV files are uploaded and stored in Drupal's file system - ensure proper file permissions are configured
  • User auto-creation creates accounts with 'authenticated' role only - administrative roles must be assigned manually
  • The module validates email formats and checks for duplicate users before creating accounts
  • Imported content inherits the published status from CSV data - review status column values before import