As you all know (or will know in a second), each entity in CRM has a logical name as well as a number (entity type code). In most places, names and numbers can be used interchangeably, e.g. when opening forms, views, dialogs and reports.
While the name, guarded by the publisher’s prefix, does not change between the deployments, the number can change when your solution is installed on another CRM system. “No problem”, you say, “I’ll always use the name”, you say. And that would be the right move that works most of the times.
However, there is an issue with CRM 2016 Word Templates in that it keeps a reference to the entity type code inside the word document xml (schema has something like ‘xmlns: http://crm-blah-blah.com/blah/entity_name/entity_typecode’. So when you deploy a solution to another system, these codes can change and, because the word template xml don’t know about these changes, if you upload via the UI the template ends up being tied to the wrong entity!
Good news: Gayan “Performance Wizard” Perera built a tool that will move word templates from one system to another. If it detects mismatching entity type codes, it’ll tweak the word template and upload.
With Gayan’s authorization, I made a XrmToolBox plugin of his tool.
Here is the project : https://github.com/MscrmTools/MscrmTools.DocumentTemplatesMover
It is also available directly in the XrmToolBox Plugins Store
error message when I try to copy some templates, other work fine
Memory stream is not expandable