In case you were wondering what that “stage for upgrade” option means and why is it there in the first place:
It’s all about deleting components from the managed solutions. The ALM whitepaper actually does a good job describing this feature, though there is a lot of other content in that document, so “stage for upgrade” may seem less important at the first glance:
Anyway, here is an example of the managed solution I have installed in the production instance:
What if I did not need that workflow anymore, and, also, what if I did not need the Test Field:
I could go to the development environment, delete the workflow and the field, update the version number, and import new version of the same managed solution. While importing that updated solution, I’d have to choose whether I wanted to “Stage for Upgrade”. What if I did not?
The solution would be imported, but the workflow would still be there:
Problem is, solution components can’t be deleted just like that. It all comes down to the reference count – the solution that’s there in the instance is still referencing the component, so the system can’t remove that component while there is a reference. And it can’t remove the reference without removing the component first.
Historically, this is where we’d be using holding solutions, and this is what we are actually doing when choosing “stage for upgrade” option.
Let’s make a note of the solution ID. When not using stage for upgrade, it stays the same:
Now let’s export another version of the same solution (it’ll be 126.96.36.199) and try importing it with the “stage for upgrade” option. This time, there will be two solutions in the target instance:
That “_Upgrade” solution is, actually, what used to be called a “holding” solution – there is no workflow in that solution, but the entity is still there:
If I now applied solution upgrade to the original solution:
The workflow would be removed since the system would do three things:
- It would remove my original solution
- It would remove any components that have no references anymore (the workflow)
- It would rename that “_upgrade” solution so the name matches original solution name
As a side-effect, solution ID would, actually, change (since it would be the ID of the former “_upgrade” solution):
PS. Through this same process, my Test Field finally got deleted as well: