Relative URL for Migrated Data

Tec T asked on October 4, 2017 08:50

We have successfully migrated data from an old cms to kentico 10 using the kentico migration tool. The problem now is that the URL for the migrated documents doesn't follow the URL pattern I have specified in the URL Pattern field for its corresponding page type. It's following the node path instead. Was looking into the database but I have no idea where to look.

So is there a way to update the URLs for the migrated data in order for it to follow the URL pattern I indicated in its page type?

Thanks!

Recent Answers


Matt Nield answered on October 4, 2017 10:30

Could you provide a little more information about where/how you are setting the URLs?

You can set a specific URL for each page if you need to in the URLs tab in the Pages application by setting a value for Page URL Path > Path or pattern. In the database, this can be found in CMS_Document.DocumentURLPath. You may need to flush the cache once youve set these values. In addition, you may run in to complications as you'll need to update the workflow process, and this might require some custom code.

As an observation (feel free to dismiss it), it looks like you're trying to maintain the structure of your old site in your newly migrated content. Have you considered using 301 redirects with URL Rewrite or a modification of this Kentico 9 URL redireciton module instead?

1 votesVote for this answer Mark as a Correct answer

Tec T answered on October 4, 2017 12:11

We're using an MVC approach in our project. We only have "Content only pages" page types so we don't have a URLs tab in the Pages application. The only tabs available are Content and Properties and it looks like there's no way to set the Page URL Path under Properties. I set the URL patterns in the Page Types application, under the General tab > URL pattern.

I looked under CMS_Document.DocumentURLPath in the database but it seems the new non-migrated data, which follows the URL pattern I specified in their corresponding page types, doesn't have any value under it. Is that how it should be? If so, how are their URLs generated? Are URLs generated on the fly?

Oh and just to clarify, we're not actually trying to map routes from the old domain to the new one. We just don't want to use the document path in the url since our paths are pretty deep.

0 votesVote for this answer Mark as a Correct answer

Matt Nield answered on October 4, 2017 12:57 (last edited on October 4, 2017 13:07)

Hi, I didn't realise that you were using MVC. CMS_Document.DocumentURLPart won't do anything for you in that case - sorry for the confusion.

I assume you have routes.Kentico().MapRoutes(); in your RouteConfig.cs? Other than that - I'm now off to read everything here: Specifying the URL pattern for content only pages :)

0 votesVote for this answer Mark as a Correct answer

Tec T answered on October 5, 2017 05:18

Hi Matt. Sorry I wasn't specific in saying that we were using MVC from the start. But at least that clarified that CMS_Document.DocumentURLPart won't have an effect. :)

Yes, I have routes.Kentico().MapRoutes(); in my config and I've read the article you sent. URL patterns are working for new data, meaning if I created a new document in the Pages application, the URL for that new document follows the URL pattern I specified.

But for the migrated data, the URL for those old data is dependent on its node path and not on the URL pattern I specified. I'm trying to change the URLs of the migrated data to be the same pattern as the URL pattern I've specified.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.