Consolidating ContentTypes using MigratonStep

Vote:
 

Our site has several existing 'identical' content types.  I'd like to consolidate this situation so that all of pages these content types are reassigned to one destination content type.

using EPiServer.DataAbstraction.Migration;

namespace MyProject.Migrations
{
    public class MigrationStep_Consolidation : MigrationStep
    {
        public override void AddChanges()
        {
            ContentType("DestinationPageType")
                .UsedToBeNamed("DuplidatePageTypeA");

            ContentType("DestinationPageType")
                .UsedToBeNamed("DuplidatePageTypeB");
        }
    }
}

All of the above Content Types already exist and are being utilized by existing pages.  The above code generates the error:

021-12-15 19:38:44,371 [1] ERROR EPiServer.Framework.Initialization.InitializationEngine: 
Initialize action failed for 'Initialize on class EPiServer.Initialization.Internal.ModelSyncInitialization, EPiServer, Version=11.20.8.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7'
EPiServer.DataAbstraction.ConflictingResourceException: 
There is already a content type registered for type: MyProject.Pages.DestinationPageType

Is it possible to use a MigrationStep to do this?  Is there a better way to do this without recreating the entire pages?

Thanks in advance.

#268476
Dec 16, 2021 2:01
Vote:
 

The 'Convert Pages' tool in the Site administration will perform the task that I need.  

https://webhelp.optimizely.com/18-5/cms-admin/converting-pages.htm

#268503
Dec 16, 2021 13:15
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.