9

We're completing the final steps of an upgrade from Web 8.5 to Sites 9 and from DXA 2.0 to 2.1. Most of the steps have succeeded so far (upgrading databases, upgrading CM and CD to Sites 9, etc.) - following the documentation here and here. We've come to the point when it is time to upgrade DXA on the Content Manager by running an import PowerShell command. However, when we run the import command, as per the documentation, we get an error message saying:

[Error] Tridion.ContentManager.InvalidActionException: Property 'TemplatePurpose' can not be updated

PS C:\install\SDL.DXA.NET.2.1\SDL.DXA.NET.2.1.0\cms> .\cms-import.ps1 -importType master-only -cmsUrl "http://localhost/
"
Installed CMS version reported to be 9.0.0.609
Copied 'C:\install\SDL.DXA.NET.2.1\SDL.DXA.NET.2.1.0\cms\DXA Application Data Definition.xml' to 'C:\Program Files (x86)
\SDL Web\config\ImportExport\ApplicationData'
Preparing upgrade to DXA 1.6 structure...
Folder '/webdav/100%20Master/Building%20Blocks/Framework' already exists; it seems that your CMS already has DXA 1.6 str
ucture.
Specify the -force flag if you want the run the upgrade anyways.
checking /webdav/100%20Master/Building%20Blocks/Framework/Developer/Templates/DXA%2EUpgrade
Folder '/webdav/100%20Master/Building%20Blocks/Framework/Developer/Templates/DXA%2EUpgrade' already exists; it seems tha
t your CMS already has DXA 2.0 structure.
Specify the -force flag if you want the run the upgrade anyways.
Uploading package 'C:\install\SDL.DXA.NET.2.1\SDL.DXA.NET.2.1.0\cms\master-only.zip' ...
Importing content ...
Aborted
2018/12/11 23:59:07 <141> [Information] Import process '7ae73a7a0c3345b4b8c4b7c3c185e869' is started by 'KCPS\djewett' a
t 12/11/2018 11:59:07 PM.
2018/12/11 23:59:07 <141> [Information] Building list of items to import and determining required import actions.
2018/12/11 23:59:07 <141> [Information] Unzipping and initializing package for import.
2018/12/11 23:59:11 <141> [Information] Import items into publication '000 Empty' started at 12/11/2018 11:59:11 PM.
2018/12/11 23:59:11 <141> [Information] Import items into publication '100 Master' started at 12/11/2018 11:59:11 PM.
2018/12/11 23:59:12 <141> [Error] Tridion.ContentManager.InvalidActionException: Property 'TemplatePurpose' can not be u
pdated
   at Tridion.ContentManager.CommunicationManagement.TemplateBuildingBlock.OnSaving(SaveEventArgs eventArgs)
   at Tridion.ContentManager.IdentifiableObject.Save(SaveEventArgs eventArgs)
   at Tridion.ContentManager.ContentManagement.VersionedItem.Save(Boolean checkInAfterSave)
   at Tridion.ContentManager.ImportExport.ImportAction.<>c__DisplayClass30_0.<SaveItem>b__0(Boolean isRetry)
   at Tridion.ContentManager.ImportExport.Process.<>c__DisplayClass35_0.<InvokeInErrorHandler>b__0(Boolean isRetry)
   at Tridion.ContentManager.ImportExport.AbortErrorHandler.Invoke[T](Func`2 function, LocalizableMessage message, Boole
an retryAvailable, Boolean isCritical, UserReply additionalUserReplyOptions)
   at Tridion.ContentManager.ImportExport.Process.InvokeInErrorHandler[T](Func`2 function, LocalizableMessage message, B
oolean retryAvailable, Boolean isCritical)
   at Tridion.ContentManager.ImportExport.ImportAction.SaveItem(IdentifiableObject item, IdentifiableObjectData deltaObj
ect)
   at Tridion.ContentManager.ImportExport.UpdateImportAction.Perform(IdentifiableObjectData itemData)
   at Tridion.ContentManager.ImportExport.Importer.ImportItem(WebDavUrl exportUrl, IList`1 dependentItemsChain, Dictiona
ry`2 unresolvedDependencies, Boolean specialImport)
   at Tridion.ContentManager.ImportExport.Importer.ImportItem(WebDavUrl exportUrl, IList`1 dependentItemsChain, Dictiona
ry`2 unresolvedDependencies, Boolean specialImport)
   at Tridion.ContentManager.ImportExport.Importer.ImportItem(WebDavUrl exportUrl, IList`1 dependentItemsChain, Dictiona
ry`2 unresolvedDependencies, Boolean specialImport)
   at Tridion.ContentManager.ImportExport.Importer.ImportItem(WebDavUrl exportUrl, IList`1 dependentItemsChain, Dictiona
ry`2 unresolvedDependencies, Boolean specialImport)
   at Tridion.ContentManager.ImportExport.Importer.ImportItems(IList`1 items, Boolean specialGroupImport)
   at Tridion.ContentManager.ImportExport.Importer.Import(String packageName)
2018/12/11 23:59:12 <141> [Information] Transactional import failed at 12/11/2018 11:59:12 PM. No changes were committed
 to SDL Web Content Manager.
An error occured while importing 'C:\install\SDL.DXA.NET.2.1\SDL.DXA.NET.2.1.0\cms\master-only.zip'
At C:\install\SDL.DXA.NET.2.1\SDL.DXA.NET.2.1.0\ImportExport\ContentManagerUtils.ps1:422 char:9
+         throw "An error occured while importing '$packageFullPath'"
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (An error occure...aster-only.zip':String) [], RuntimeException
    + FullyQualifiedErrorId : An error occured while importing 'C:\install\SDL.DXA.NET.2.1\SDL.DXA.NET.2.1.0\cms\maste
   r-only.zip'

Some additional information:

After some investigation, it appears this property is a new property introduced to the CM database in Sites 9, as I see the column for it after having upgraded our CM database. And the DXA 2.1 import package also contains the field:

enter image description here

However, it seems that because the values currently in the CM database are all null, the import is blocked from overwriting existing rows. I can run a SQL statement to enumerate which templates have the null TemplatePurpose and which are likely the culprits:

enter image description here

It turns out, the templates causing the issue are all of the templates in the 100 Master/Building Blocks/Framework/Developer/Templates/DXA.Legacy and DXA.R2 folders:

enter image description here

2 Answers 2

6

One workaround I've found is to temporarily move all of the aforementioned templates into temporary new folder locations, to allow the import operation to succeed. Then, once the cms-import.ps1 script is successfully run, the new templates will be in the correct location. Finally, to make this work, it's necessary to compare each of the new templates to the corresponding older versions, using Where Used to update any dependencies to point to the new templates. All-in-all, this approach works well, I've been able to run and test the DXA 2.1 web application and it's relatively non-time-consuming (takes about a couple hours max).

2
  • Note also that there is a new TBB called "Extract Components from Regions" Commented Dec 31, 2018 at 6:12
  • 1
    Good to hear you found a work-around yourself, but this seems to be an issue with the CM Core and/or DB upgrade process. Please report this issue with SDL Customer Support. Commented Jan 7, 2019 at 19:43
1

There is a new recommended option for upgrade: -importType framework-only that upgrades only DXA framework templating code, but does not touch most of the items in the Master publication. Try it.

2
  • I'm worried that might not give me everything I need, since I'm trying to do a full upgrade from DXA 2.0 to 2.1, and according to the documentation, I should be using the master-only option: docs.sdl.com/LiveContent/web/… Commented Jan 2, 2019 at 19:19
  • Tried framework-only option, however got next error: [Error] Tridion.ContentManager.ImportExport.ImportExportException: Item '/webdav/100%20Master/Building%20Blocks/Modules/Core/Editor/Schemas/Page%20Schemas/Include%20Page.xsd' cannot be imported because it is absent on import TCM and its content was not exported to the package. Commented May 8, 2019 at 17:58

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.