Migrating page types while preserving keys between tables

Scenario: Migrate from Kentico 11 to Xperience by Kentico page types in ContentHub while maintaining table relationships.

Tags:
Content modeling Content types Migration / upgrade
0

Answers

Could you provide examples of:

  • Things you've tried
  • Documentation you've consulted
  • Your source page types and what you are trying to migrate to

That would go a very long way towards people being able to help you.

All that said, the Kentico Migration Tool is dedicated to supporting these migration scenarios, which are showcased in the repo's documentation.

0

i am using Kentico Migration Tool
in config file "ConvertClassesToContentHub": "custom.BlogAuthors;custom.BlogPosts",

page type custom.BlogPosts has field PostAuthor type text, Form control: drop-down list (SQL query = SELECT BlogAuthorsID, Name From custom_BlogAuthors)
After migration, I need to create a link between these content types

0

Alex,

There are a couple options, but here's what I would do:

  1. Migrate with the data as is (an ID of the blog author id)
  2. Once data is migrated, make a NEW field (Content Items: Blog Author) for the reference to the Content Author Content Item, and use the API and loop through your items, read the old BlogAuthors ID, and using that find the new Blog Author Content Item and update the field.

You'll need to look at the Blog Authors and make the mapping using some SQL and stuff. Some stuff is better to make an import script yourself sometimes, or try using the AI Kentico CoPilot to write it out.

0

Can I migrate only this page types?

0

Alex,

Yes you can migrate pages individually or together with other page dependencies.

0

I'm transferring the data as is. The total is 3,948 pages. But
var posts = await contentQueryExecutor.GetResult( new ContentItemQueryBuilder() .ForContentType(BlogPosts.CONTENT_TYPE_NAME), p => new { PageId = p.ContentItemID, PostAuthor = p.GetValue<string>("PostAuthor") }

); return only 1978 pages. Does Kentica have any restrictions?

0

Alex,

The Kentico Migration Tool uses Entity Framework Core for database access and Xperience by Kentico uses ADO.NET, neither limits the results returned by a query, and especially not an arbitrary quantity like 1978.

If you don't trust the results returned in your query, try writing the SQL yourself and executing it against the database.

If you are unsure what SQL is being generated by your query, add the MiniProfiler integration to display those queries.

0

I wrote sql query in SQL Server Management Studio and result is 3948

0

Alex,

In general, it would be helpful if you shared more information in your responses, which tend to be very brief in this discussion 😅. For example, you state:

I wrote sql query in SQL Server Management Studio and result is 3948

  1. What was this SQL query? Sharing the details behind these statements makes it much more likely someone can actually help you.
  2. Did you use the MiniProfiler integration to identify the query run by your ContentItemQueryBuilder query using .ForContentType()?

    Note: As mentioned in several other recent discussions, .ForContentType() is the oldest querying approach in Xperience by Kentico. We recommend using IContentRetriever or at least .ForContentTypes() (note the plural s at the end).
  3. Were any of the other answers or suggestions already provided helpful?
  4. How much progress have you made in your original scenario? Are these follow-up questions related to it?
  5. The suggestions outlined in our blog post Kentico Support: Help us help you! apply here as well.
0

To response this discussion, you have to login first.