Hi

I am quite new to Drupal... only 2 weeks!

I am struggling to import data from Blogger (I have the xml file). Blogger_importer only works on v6. So I imported into a temp site built on v6, then created a view to export the fields i want into csv files... all that is ok.

The problem I have is to import these csv files into v7.

How do I do that? Is their a module which is ready for v7? I have not found one yet.

Alternatively, I could write a simple php script to read the csv file and populate the different tables/fields of articles, comments & users data. But where do i find a simple explanation on what are the important tables/fields to populate?

Your help will be greatly appreciated...

Paul

Comments

mattbk’s picture

Welcome to Drupal!

You might try the Feeds module (http://drupal.org/project/feeds), but I'm disappointed in it at the moment because it doesn't seem to easily map to fields in D7. If that doesn't work for you, you're probably in the same situation I am.

An option that seems more viable is Power Import (http://drupal.org/project/pimport), but they aren't even started on D7 yet.

Good luck.

kenorb’s picture

Currently Feeds has the mapping for the fields.
It import or aggregate data as nodes, users, taxonomy terms or simple database records.
I think it's the best solution right now for importing CSV with no coding required.

aangel’s picture

JuliaKM’s picture

I've done this before in Drupal 6 and would recommend using Migrate but first importing your CSV file into a MySQL database. It'll make the migration process a whole lot less painful.

dotman’s picture

i'm using feeds becasue i'm not a developer and Migrate for D7 doesn't seem to have a ui. i have imported my sql server db in MysSql. what are the steps for bringing the content in for a non developer?

thanks.

quazardous’s picture

doing a csv import plugin on top of datasources should be very easy :
http://drupal.org/project/datasources

tabvn’s picture

Hello paulgodard,

if you want to import your csv and want to use it as node in drupal.

1/ create a new content type and add field to fit with your csv .
2/ you need to write new module and read your csv file http://php.net/manual/en/function.fgetcsv.php
and each line you can use funciton node_save to save content to your database as node.

check more about node_save here http://api.drupal.org/api/drupal/modules--node--node.module/function/nod...

Toan,

alltooeasy’s picture

Hmm,

Battling a bit with this. Can't seem to find the right combination of things.
Got a CSV to import and create a node. But struggling to get it to match the correct fields from the CSV to the fields in Drupal. Something is going wrong.

I've been over a few "template CSVs" but maybe I'm missing something.
Also trying to use Location data which has to run through the location module and Gmap (using Google Map API). I set up a Content Type and a dummy CSV to using the necessary fields. But it keeps making one node, editing 99 - thats a total of 100 items in the sample CSV to be used.

I can create a node with a map and location, but can't import stuff. Now getting a bit frustrated and can't seem to find a format guide or example.

Also on which note, if you're repeating this process, e.g. to update a bunch of statuses on locations, or adding more locations. What do you think should be the best way to do it?

2 x feeds? One runs after the other. One create the locations on upload. The other populates them with status?

Seems to me that If I had a tiny dog - I'd tell it that we're not in Kansas anymore.

Don't suppose anyone has a good Tut on this in D7.

Tammie’s picture

I'm trying to do nearly the same thing, so if you figure it out, please let me know (and I will do likewise).

Tammie’s picture

I am VERY new to Drupal, so this may not be 100% right - though it does seem to work for me to create a new node with corresponding field data.

function make_nodes($nodes) {
	foreach($nodes as $new_node) {
		$node = new StdClass();
		$node->type = 'book';
		$node->title = $new_node['title'];
		$node->uid = 1;
		$node->language = 'en';
		$node->body['und'][0]['value'] = $new_node['body'];
		$node->field_legacy_title['und'][0]['value'] = $new_node['field_legacy_title'];

		node_submit($node);
		node_save($node);
	}	
}

Not sure if that's what you're after or not, but perhaps it will help someone.

wusel’s picture

Please have a look at http://drupal.org/node/1285276

Maybe it can help you.
Much success.

Wusel

terbs’s picture

If you want a really robust solution, write a custom module that uses the form+batch API. Sometimes I find it to be difficult to use feeds/migrate for anything but the most basic of use cases.

http://bitcookie.com/blog/importing-csv-file-drupal-programmatically-using-batch-api

pal4life’s picture

Importing data is a basic function of most of the sites and this is something that most sites always need. Drupal not having a simple solution for this gives bad reputation to it. Especially if this is one of the first links which pops up for importing data in to drupal google search. I wish Drupal added this functionality in core and just made it a basic simple import process.

I have been battling with feeds importer and it gets confusing every single day. No option to import new data there.

WorldFallz’s picture

I doubt very much this will be added to core. If core included everything people thought 'most sites need and not having reflects badly' it would impossible to run on anything less than a cray, lol. Feeds works. The UI can be a little confusing, no question, but it works and works well and for an amazing variety of use cases to boot.

Jaypan’s picture

Drupal not having a simple solution for this gives bad reputation to it.

No it doesn't. Drupal beats every other open-source CMS hands down. A 'missing' feature that is only needed by a small number of users doesn't bring its reputation down, it only adds frustration for those who won't take the time to learn module development so that they can build it themselves. If there really was a problem, they would leave for another CMS, but of course they already know Drupal is the best one.

PeterPP’s picture

Thanks for the info on this everyone, saved me some time looking for it all. I was worried about importing some data and it still seems like it is an issue but these workarounds will be great.