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:
- Enable feeds module.
- Create a custom content type with fields to be imported.
- Create a new importer (/structure/feeds importers)
- Basic settings:
- Attach to content => standalone form
- Periodic import => off
- Import on submission => checked
- Fetcher: In File upload,
- File upload settings => Allowed file extensions (Add CSV or XLS else whatever extension you want.)
- 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.
- Processor: node processor
- 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.
- Save all configurations.
- Your import url would be site/import/importer-name(you have created on step 2) and not node/add/ importer-name.