Take the 2-minute tour ×
ExpressionEngine® Answers is a question and answer site for administrators, end users, developers and designers for ExpressionEngine® CMS. It's 100% free, no registration required.

I have a CSV that I'd like to import into EE. Looking at exp_channel_fields, I think I am able to connect them to the appropriate columns in exp_channel_data. Basically, it seems like the value in exp_channel_fields.field_id is used to make exp_channel_data.field_id_x (where x is the field_id value).

But there is also this field_ft_x column. What is that for?

Is doing an import as simple as just putting my data in the appropriate columns in exp_channel_data? Is there an easier way to do this?

share|improve this question
add comment

5 Answers

up vote 5 down vote accepted

Generally the best option is to use DataGrab. It can import from CSV files, as well as XML and other formats.

The field_ft_x column stores the field "type". This is different from the fieldtypes you are probably thinking of though. For example, a "textarea" field has the option to choose which format it's in - things like None, Auto BR, HTML. You can also install new options in the list (and probably have already) such as Markdown.

share|improve this answer
    
The HTML's form field "type?" Why would that be in the exp_channel_data? Wouldn't that just be duplicating data? –  ExpressionEngineNewbie Nov 30 '12 at 1:16
    
Oh, I suppose the type could change? Thus, this is more of a historical record of the field type when the data was entered? –  ExpressionEngineNewbie Nov 30 '12 at 1:27
add comment

To add an entry to EE, you need to enter data in a minimum of two places: an entry in exp_channel_titles and a matching one (by entry_id) in exp_channel_data.

The entry_id field is not auto-incremented, and so you're best to enter the data in a transaction, in case the (very rare) circumstance happens where the control panel is used to add an entry just as you're importing the data. Or, you can write a big batch of queries and just start it at an entry_id you know isn't taken already.

There are, of course, circumstances where you have to add data more places: if it's a new author, if your data uses categories, if it uses matrix data (a common third-part add-on), if it has comments...

Each field stores its data in the exp_channel_data column called field_id_##, and the matching field_ft_## column is used to describe how that content should be OUTPUT later by EE. (i.e. field_ft is not a description of how the data is being stored, just of how it should be displayed. Data is usually stored as unformatted as possible.)

Each field has a default format, but every instance (entry) of data for any field can be set within EE to output its content in a variety of ways, so that's why that's there.

It's true, you don't need to use the third-party add-ons suggested here for simple data import needs. But the moment your data gets more complicated, they do a wonderful job of navigating that complexity and resolving data conflicts. Datagrab tends to be updated more often.

share|improve this answer
add comment

There are 2 major add-ons for importing csv files (and other filetypes) into EE:

Both work similar, each has its own quirks and extras. A lot depends on properly formatted csv files, and both map to already defined channels/custom fields.

share|improve this answer
    
Are there non-commercial options? Can't I just do this via MySQL? –  ExpressionEngineNewbie Nov 30 '12 at 1:13
    
none that I'm aware of. But given the dev time they can save both are well worth the money, especially if you have to do repeated imports. –  erwinheiser Nov 30 '12 at 8:18
1  
I would second DataGrab and underline the point about formatting the csv file. The import is easy, the hard bit it getting the file right to start with. –  foamcow Nov 30 '12 at 11:41
add comment

+1 DataGrab nice & simple.

share|improve this answer
add comment

I've used datagrab lot of time and it works well! It also imports in Playa fields. I only find some problems when I need to assign category/subcategories. I've never use solspace importer but it should be more expensive than datagrab.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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