It's possible to import content that is related to one or more contentlets that already exist in the system. Content can be related on import regardless of whether the relationship exists between two different Content Types or the Content Type is related to itself.
Importing Content with Relationships
In the image shown below, a relationship field has been added on two different Content Types - Employee and Location. Several “Employees” and “Locations” have already been created as content in the system.
To import the desired content, choose the “Import Content” option instead of the add new content option on the Content Search manager.
Choose the Content Type, content language version to import, a workflow action and, if needed, download the sample .CSV file.
Handling Existing Relationships
In the CSV file, the relationship field should be visible in the header. The imported CSV file can replace, remove, or preserve content using the following values:
|Value Supplied for Relationship Field||Result|
|Comma separated list of identifiers and/or Lucene queries||Replace existing relationships (if any) with new relationships to the specified content.|
|Empty value||Remove all existing relationships (if any).|
|No column for the Relationship field||Preserve (do not change) existing relationships (if any).|
Verifying the Import
Then upload the file and preview the import file for errors. The import of content with relationships will fail if there are any errors in the import preview report.
Once you have imported the content with relationships, do a filter search for the related content, using the relationship field or edit a few pieces of content and verify that the relationships field has been populated with the related content data.