3

We imported the DXA out-of-the-box BluePrint and want to maintain it.

Can Content Porter transfer those publications to new publications (on the right) on the same CMS server?

  • 100 Example Master => 100 Master
  • 110 Example DXA Site Type => 110 DXA Site Type

What I did: Extract .zip and change mapping.xml.
I expect you have to more xml files with same replace string.

enter image description here

enter image description here

A lot of data is involved

enter image description here

2 Answers 2

5

No, not really, but besides modifying the package that you already did or tried, you can do second sort of hack. You can export from 100 Example Master then temporarily rename it to maybe 100 Example Master TEMP then you do import (it will import publication as 100 Example Master and you rename it to 100 Master). And finally, you revert the name for the original publication from 100 Example Master TEMP to 100 Example Master

It's a hack, but there is no option to rename during import.

This is because sole purpose of content porter is to move same items between environment. It is not a copy paste tool. Other option is to write core service script to copy publication or, as a second option you can use ExportImport service to write your own logic.

2
  • 1
    Your hack works. I had to change the publication key (2nd field in publication) also to TMP and then it could be imported. Commented Nov 4, 2020 at 9:18
  • Afterwards in my case with sides9 it would be better to use importype "framework-only" and/or "master-only" to import the DXA objects. Commented Nov 5, 2020 at 11:29
1

In theory, yes, you can use the Content Porter for this, as it does support mappings, but in practice, this would involve hand-crafting a mappings file, and you are already starting to see the difficulties in doing that.

The approach of renaming publications has a long history. (Some of us call it "the webforms hack" because it was part of the installation process for Tridion WebForms back when that was a thing.) For simple use cases, this will be just fine. So if you simply want to replicate exactly what you have, the amount of content is small, and you only want to do it once, and not in production, this is a reasonable choice. Obviously YMMV based on any of those variables.

The good news is that the Import/Export API makes this much more practical. You can define your mappings in code, and they can then be applied without performing surgery on your exports. If you have a lot to port, and wish to split it up into many smaller exports/imports, then it's relatively easy to apply the same mappings to them all. You have to create the target publications first, and then import into them. This prevents the Import API from having to deal with BluePrinting issues, and to be honest, you probably want personal control of where things go in your BluePrint. There have been some fairly recent fixes done by R&D in this API, so I'd suggest contacting support to make sure these have been applied to the version you are working on.

1
  • On develop environment we can do that approach. Is there a code example how that should look like? Commented Nov 4, 2020 at 19:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.