How to import bulk data in Drupal7?

May 09, 2016 - 07:40

I had a requirement to import bulk data to database. Drupal module feeds helps you with this.

Either you can add url of the data to be imported or upload the file which has bulk data. If want to add url to import data from some other source, use feed importer. The steps to create a feed importer are here.

If you want to import as a file, use the following steps:

  1. Enable feeds module.
  2. Create a custom content type with fields to be imported.
  3. Create a new importer (/structure/feeds importers)
  4. Basic settings:
    • Attach to content => standalone form
    • Periodic import => off
    • Import on submission => checked
  5. Fetcher: In File upload,
    • File upload settings => Allowed file extensions (Add CSV or XLS else whatever extension you want.)
  6. Parser: Choose parser as per your extension. If you add CSV as the extension choose CSV parser. If you add XLS extension add Excel parser. Default would be CSV parser.
  7. Processor: node processor
  8. Settings for node processor:
    • Go to 'Choose Bundle' and its to be created content type to be imported into.
    • Mapping => Unique field to the GUID and rest to the fields created.
  9. Save all configurations.
  10. Your import url would be site/import/importer-name(you have created on step 2) and not node/add/ importer-name.