By Selective Export/Import I try to deploy two Catalogues. The Items of one Catalog have a relationship attribute with the another one.
I Export/Import the structure and content of these Catalogs (without dependencies errors). All correct unless the relationship attribute.
All the information about this attribute has not pass (the content).
I miss a step? There is a known issue about these?
Pinned topic Selective Export/Import Relationship attribute issue
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2013-02-13T20:11:19Z at 2013-02-13T20:11:19Z by SystemAdmin
Re: Selective Export/Import Relationship attribute issue2013-02-13T12:21:18ZThis is the accepted answer. This is the accepted answer.Hi,
Well, if you try to get a value of a relationship attribute via a script, you get some number. It is ID of item in the database, not a primary key. So I suppose, when you are exporting a content of an item this ID is saved in an export file. Then when you are importing the item into a new environment, there is no a item with the same ID in the new environment and the relationship attribute stays a blank.
To confirm above you should look at the content of the item in the export file and see if ID or primary key is stored there.
StefanR 060000URD37 Posts
Re: Selective Export/Import Relationship attribute issue2013-02-13T12:31:57ZThis is the accepted answer. This is the accepted answer.
- SystemAdmin 110000D4XK
Re: Selective Export/Import Relationship attribute issue2013-02-13T16:24:13ZThis is the accepted answer. This is the accepted answer.
- StefanR 060000URD3
Next time I will think hard about creating a relationship attribute or not.
Thank you all for the information :)
Re: Selective Export/Import Relationship attribute issue2013-02-13T20:11:19ZThis is the accepted answer. This is the accepted answer.
- SystemAdmin 110000D4XK
I came across the same problem as you.
So a recommendation is not to use a relationship attribute but a linked item since that is being processed correctly.
I have created some kind of new import. This is what is stated in the original environment_catalog_content_import_script:
else if ( attr_value.startsWith("RELATIONSHIP_INFO") ) //Fix WPC00033069
// XXX-Wolf-15-dec-Srikanth-16-jan-FIXED Relationship will have to be handled eventually though
// XXX-Srikanth-16-jan Relationships are handled in recursive import.
// skip because this can cause circular dependencies - items can be
// related to items in the same catalog or catalogs not yet loaded -
// this has to be taken care of in a second pass
So, understandable it is too complex the import should test if the other catalog is available.
I did it like this.
First import the catalogs and content. They do not fail, just the relationship fields are empty.
Then i replaced the environment_catalog_content_import_script with my own script and ran the import again. The script did do nothing else then take the value from the import and put it in the fields.
I have added my script. I just put in the fields hardcoded, but you can also do it if it has anything do to with RELATIONSHIP_INFO:
item.setEntryRelationshipAttrib(attr_name, ctg, attr_name_value);// is the place where the link is stored
that should do it.