TD 14SP2 Content Importer - Importing XML items that do not exist in the repository (advanced)

Please, read this post first: https://community.sdl.com/product-groups/sdl-tridion-dx/tridion-docs/f/forum/29947/td14-content-importer-replacing-batch-import for an overview.

Starting points for this scenario:

  1. The items do not already exist in the repository
  2. The user running the import has the required credentials to create the items in the repository
  3. The Tridion Docs setup has no database mandatory custom fields for the to be imported item types
  4. All files have the correct filenaming convention
  5. The files have been moved/copied into a single folder (referred to as input folder)
  6. All items have the same object type (either map, topic or library topic)

Possible use cases for this scenario:

  1. Import of localized files for which the 'enable translation management' option has been switched of
  2. Importing library topic files exported by another system

There are 2 possible ways to do this:

  1. Using the 'Standard' import option
  2. Using the 'Without conversion' option (advanced)

The standard option works similar to https://community.sdl.com/product-groups/sdl-tridion-dx/tridion-docs/f/forum/29950/td14sp2-content-importer---importing-illustration-items-that-do-not-exist-in-the-repository with the only difference to select a folder with the correct folder object type.

However this will not always work:

  1. Any file with an outgoing link to another repository object will fail to import because the content import validates all references and the references must be in the format of a filename and that file must exist. Because the reference is never in the format of a file and the file will not always exist, this is never going to work for files with references.
  2. XML files will be converted. In most cases this is not a problem but one known issue is that DITA conditions are replaced by an @ishcondition attribute and if both are set then the @ishcondition attribute might get overwritten. Although there are some options in a configuration file that may or may not work this conversion is s a small risk. This risk can be eliminated by comparing the input and output folder and as a work-around overwrite the files in the output folder with the files from the input folder before pressing 'Continue with import'.

So issue 2) can always be worked around but issue 1) practically not unless you consider to remove all @href attributes from the files in the input folder and then update the files with the original files in the output folder before pressing 'Continue with import'.

About the other option 'Without conversion':

This option does not introduce the two issues mentioned above but it requires to create a so-called .3sish file for each to be imported item. These .3sish files are similar to .met files and contain the metadata information used for the import. These .3sish files are generated in the output folder using the 'Standard' option. Actually the 'Without conversion' means basically to execute only the importing step starting with a folder that could have been created by the 'Standard' option. This is a golden tip for those who want to understand the internal working of the content importer but this post is more focused on the scenarios.

To create the .3sish files requires scripting or programming where most of the content can be derived from the filename.

Take the following filename as example: T_Test-import=GUID-20849930-932A-4AD6-8EC4-54819948296E=1=en-US=.xml the content of T_Test-import=GUID-20849930-932A-4AD6-8EC4-54819948296E=1=en-US=.3sish will look as follows:

<?xml version="1.0" encoding="utf-8"?>
<ishobject ishref="GUID-20849930-932A-4AD6-8EC4-54819948296E" ishtype="ISHModule">
  <ishfields>
    <ishfield name="VERSION" level="version">1</ishfield>
    <ishfield name="DOC-LANGUAGE" level="lng">en-US</ishfield>
    <ishfield name="FTITLE" level="logical">T_Test-import</ishfield>
    <ishfield name="FAUTHOR" level="lng">Ymte Westra</ishfield>
    <ishfield name="FSTATUS" level="lng">Draft</ishfield>
<!-- custom fileds can be added here -->

    <ishfield name="FCHANGES" level="version">Content imported by Ymte Westra .</ishfield>
  </ishfields>
</ishobject>

When all these .3sish files are in place then the procedure is similar to https://community.sdl.com/product-groups/sdl-tridion-dx/tridion-docs/f/forum/29948/td14sp2-content-importer---updating-a-batch-of-items-that-do-already-exist-in-the-repository . The obvious difference is that in this scenario the items do not already exist in the repository. In that case the content importer needs the .3sish files to create the items with initial metadata.