How to create nodes with hierarchical terms from excel

The purpose of this cookbook is to show how to create node from a excel documents via csv files.
The example we use is a list of stores with name, adress and three column to convert to terms a state,capital ubication and a kind of store column.

Create migrate module

First thing we are going to do is make a tipically module named migratestores.

migratestores.info

All Versions - Importing Data and Files in CSV - UTF-8

Feed importers are the solution to import lots of data to your side, but nothing is more frustrating then finding the import breaks off right at the start or half-way down.
This is often caused by special characters - e.g. æ ø å ö ä ü.

To prevent this, the CSV file you intend to import should be encoded in UTF-8 - but how do you get it into this format?

One way is to create the CSV file with Microsoft Excel, then use an advanced editor like PSPad to set the encoding to UTF-8. Once you save the file, it should be ready to import.

Importing content from a csv emailed to an address using mailhandler

First Draft so I don't forget the process for the future.

This is the process used to import a csv that was sent to a gmail address using feeds and mailhandler. Everything is on Drupal 7

This is a rough approximation of what I did. Some things need some polishing e.g. I set it up to import even if it isn't authorized on the file import. I need to secure that.

Install PHP IMAP library (On your server)
First install Mailhandler
Install Feeds
Install Attachment Links

Create the Gmail account you will be importing from.
Enable POP in Gmail ( I Also set it to archive messages once they were downloaded to prevent multiple imports.

Enable the modules you installed on the site.
Create the content type you are trying to import.
Create a file holder content type to hold the csv you are importing from. On the content type edit page there is a new vertical tab for attachment links, enable it for the file field. I set it hold one fiel and used the file widget.

Structure > Mailhandler Mailboxes
+ Add
There is a bug currenlty when it tries to use ajax to test the settings. Fill out the domain and password last, you may have to save it and come back in a couple times. Before clicking save always click elsewhere on the page to initiate the ajax call and wait for it to complete or it won't save the settings.
For Gmail use pop as the protocol

Subscribe with RSS Subscribe to RSS - csv