Is it possible to change the guid of a feed and update existing nodes? I've been trying to get this to work for several hours, but there doesn't seem to be any way to set a different guid and update existing nodes, as opposed to creating new ones.

Here is the situation:

I have a large dataset, originally imported from a .csv via feeds. It contains at least two unique fields.

I chose one of the fields to be the guid.

Now, I have data coming in from another source that uses a different unique field. (Included in the original data, but not set as the guid.) These are also in .csv files.

Ideally, I could just change the mapping of the guid and import the new data, to update existing nodes. When I attempt to do this, I create new nodes.

I have tried:
setting the new guid to not unique
setting the new guid to unique
not setting any guid and importing the new data

All of these result in the creation of new nodes.

I can't leave the original guid mapped, because mapping fields that are not included in the new data results in them being overwritten by blanks.

Is there any way to do this? Please let me know.

Comments

jenyum’s picture

Issue summary: View changes
twistor’s picture

Can you try this? Leave the GUID field mapping, keep it marked unique. Then add the second mapping, to the URL field and mark that as also unique.

jenyum’s picture

That updated the nodes, but didn't populate the new field that I need to populate. There is nothing special about this field, it's not unique and it's a plain text cck field. Why would it not pull in the new field for existing nodes? If I try this without the unique identifier problem it works.

Edited to add: For now, I have solved this problem by calling the source of the new data and requesting the other field. (Which they have! Problem solved. Why did I stay up all night working on this?) But this is functionality that feeds probably should have, because I can't imagine I'm the only person who will ever discover she needs to change the unique identifier.

twistor’s picture

What is you Update/Replace/Skip existing setting?

jenyum’s picture

Update existing nodes. I need to add or update a field on an existing node.

jaysonjaynes’s picture

I don't know if this is off this topic, but I have old, existing nodes that I tried to add a GUID to (it wasn't assigned already), and then use that to match on another Feed, but it's not working for the ones I've updated, but does work for new nodes I imported with a GUID. My question: Does a GUID have to be assigned when you first upload, or can it be assigned after?

MegaChriz’s picture

To update existing nodes, you need to have an unique target. This doesn't have to be the GUID. This basically means you can assign a GUID later on.

In order to update existing nodes, the following conditions must be met:

  • There needs to be one field that contains the unique value for the node. It will not work if you have an unique value for some nodes in field a and an unique value for other nodes in field b.
  • The same unique value must be in your data source. If the unique value in your data source does not match the unique value in the database, you cannot update existing nodes.
  • You need to map to the unique field in the Feeds mapping configuration.
  • You need to be able to select the unique field as an unique target in the Feeds mapping configuration (when you install the Field validation module + the patch from #661606: Support unique targets in mappers you can select nearly every field as an unique target).

If you can meet these conditions without assigning a GUID, then it is possible to assign a GUID later on to update nodes.

jaysonjaynes’s picture

Thanks, MegaChriz! I'll try the Field validation module along with the patch. The thing is, it works for nodes that I imported a unique GUID in the initial import, but not the ones that I updated with unique GUIDs in a second import. Strange, but I'll try what you suggested.