Export/Import function uses Name to identify destination content type instead of GUID or ModelType

Found in

EPiServer.CMS.Core 7.0.586.0

Fixed in

EPiServer.CMS.Core 11.9.2

Created

Jun 08, 2018

Updated

Jun 29, 2018

Area

CMS Core

State

Closed, Fixed and tested


Description

In a multisite project, I have some page types with the same name (e.g: StartPage, ContentPage), for some reason, on DXC and my local environments . The names are different but they are of the same type (same GUID, ModelType).

When using Export/Import function to import from the DXC environment to my local, because the names are different, the import doesn't work correctly when it bases on the Name of content type to identify the destination type. This leads to the wrong content type after importing.

Note: This is the designed behavior of export/import but it should be reviewed.

Steps to reproduce on Alloy:
1. Create new Alloy site (v10 or 11), build and run locally first.
2. Create 2 new page types, say it's
SimpleAlloy.Models.TestPages.Namespace1.StandardPage
SimpleAlloy.Models.TestPages.Namespace2.StandardPage

The namespace can be different but the name must be the same.
3. Build and run, verify those 2 new content types appear in Admin -> Content Type, with the name one by one is:
SimpleAlloy.Models.TestPages.Namespace1.StandardPage: StandardPage(1)
SimpleAlloy.Models.TestPages.Namespace2.StandardPage: StandardPage(2)
4. Clone current db to another one and import to MSSQL, target Alloy connection string to this new clone db.
5. In the code, exclude those new StandardPage out of project, build and run, verify in Admin -> Content Type that they are removed from db.
6. Include SimpleAlloy.Models.TestPages.Namespace2.StandardPage in project, build and run, verify in Admin -> Content Type that it appear there with the name: StandardPage(1)
7. Repeat the same as 6 with SimpleAlloy.Models.TestPages.Namespace1.StandardPage, and now it has name StandardPage(2)
8. Verify again on both db by changing connection string between these, make sure:
On Db1:
SimpleAlloy.Models.TestPages.Namespace1.StandardPage: StandardPage(1)
SimpleAlloy.Models.TestPages.Namespace2.StandardPage: StandardPage(2)

On Db2:
SimpleAlloy.Models.TestPages.Namespace1.StandardPage: StandardPage(2)
SimpleAlloy.Models.TestPages.Namespace2.StandardPage: StandardPage(1)

9. On db1, add some new content for SimpleAlloy.Models.TestPages.Namespace1.StandardPage, use export to export only these contents.
10. On db2, import the new contents, verify the content type.

Expected:
After import, the new content items in db2 should be SimpleAlloy.Models.TestPages.Namespace1.StandardPage.

Actual:
The new content items are SimpleAlloy.Models.TestPages.Namespace2.StandardPage.