We have an old CRM instance with multiple publishers and prefixes, all unmanaged, that have accumulated over years - with many interdependencies between all the publishers and objects. We would like to move to managed solutions only - and start using ALM using a single publisher going forward.
Trying to separate these cleanly into different solutions by publisher and then converting to managed doesn't seem to make sense given dependency issues.
Questions:
Thank you!
Hey Allan, thanks! I was able to follow this basic strategy and am now using source control and ALM properly! Wow, what a relief!
Hello @taylorgmojo ,
Migrating from an unmanaged CRM instance with multiple publishers to a managed solutions approach can be challenging due to the interdependencies and sheer volume of components involved. Here are detailed answers to your questions and steps to help you achieve this:
Yes, it is generally safe to merge multiple publishers into a single solution to facilitate ALM (Application Lifecycle Management). This approach helps streamline your development and deployment processes. However, careful planning and execution are required to handle dependencies and ensure that nothing breaks during the transition.
Given the vast number of components, manually inspecting and adding each object is impractical. Instead, you can automate the process using PowerShell scripts and the Dynamics 365 Web API.
Here’s a step-by-step approach to automate the process, you can do it manually bue also try in a programatically way:
Install the Dynamics 365 PowerShell Module:
Install-Module -Name Microsoft.Xrm.Data.Powershell
Connect to Your CRM Instance:
$crmConn = Get-CrmConnection -InteractiveMode
Retrieve All Unmanaged Components: Use a PowerShell script to fetch all unmanaged components from the CRM instance and add them to a single solution.
# Load required assemblies
Add-PSSnapin Microsoft.Xrm.Tooling.Connector
# Connect to the CRM organization
$conn = Get-CrmConnection -InteractiveMode
# Solution unique name where you want to add components
$solutionUniqueName = "NewManagedSolution"
# Function to add an entity to a solution
function Add-EntityToSolution($entityLogicalName) {
$addReq = @{
ComponentType = 1 # Entity
ComponentId = (Get-CrmEntityMetadata -conn $conn -EntityLogicalName $entityLogicalName).MetadataId
SolutionUniqueName = $solutionUniqueName
}
Add-CrmSolutionComponent @addReq
}
# Function to add all unmanaged entities to the solution
function Add-AllUnmanagedEntitiesToSolution {
$entities = Get-CrmEntityMetadata -conn $conn -EntityFilters Entity
foreach ($entity in $entities) {
if ($entity.IsManaged -eq $false) {
Add-EntityToSolution -entityLogicalName $entity.LogicalName
}
}
}
# Execute the function to add all unmanaged entities
Add-AllUnmanagedEntitiesToSolution
Convert the Solution to Managed: After all components are added to the new solution, export the solution as unmanaged, and then re-import it as managed.
Export Solution as Unmanaged: Go to your Dynamics 365 environment, and export the newly created solution as an unmanaged solution.
Re-import as Managed:
By following these steps, you can consolidate your unmanaged components into a managed solution, streamline your CRM environment, and enable effective ALM practices going forward.
I don't think you'll like the answers:
1. Yes, If your various solutions share a prefix. Conflicting publishers can often mean conflicting prefixes, and this is a problem for bundling a managed solution. A managed solution can ONLY contain components with its associated publisher's prefix so, for example, if you settle on xyz_ and you try to include a table abc_mytable Dataverse will refuse the solution because the prefix doesn't match. In that scenario, the only way to merge those components would be to rebuild them under a unified prefix (note: the publisher doesn't need to match: just the prefix).
2. All unmanaged solution components are kept in the Default solution layer. If you open the Default solution, you will see them all. Unfortunately, this does not help you because practically EVERYTHING is in the default solution layer, whether you use it or not.
3. I don't have a ready-made script for you, but the unmanaged solutions you have right now are probably the right place to start. If it were me, I would write a program to read in the solutions one at a time and build an XDoc from them, then carefully merge those XDocs to build one solution, editing publisher prefixes as I go. This will not be quick or easy; you will find that solution XML is complex and often unordered, making it challenging to merge components authoritatively. Manual review and hand-merging will probably be necessary in many circumstances, so I don't recommend this path for anyone that isn't VERY comfortable with solution XML.
WarrenBelz
109
Most Valuable Professional
Michael E. Gernaey
82
Super User 2025 Season 1
MS.Ragavendar
72