Connection to old Kentico DB from Kentico 13

lawrence whittemore asked on September 24, 2021 19:28

Just curious what is the recommended way to connect to an old kentico database. I'll need to pull some user info, and document info that we have as part of our intranet. The documents are related to the users through a third table.

So far, just testing I have set up entity framework and tested on a single table and was able to pull in info using a dbcontext and a repository. Am I on the right path or is there a better way to do this?

Recent Answers


Dmitry Bastron answered on September 27, 2021 06:25

Hi Lawrence,

Is there any particular reason why you want to keep the old database active rather than migrating data from the old database to a new one and use Kentico API to read the data from it?

0 votesVote for this answer Mark as a Correct answer

lawrence whittemore answered on September 27, 2021 14:00

The old site will still be running. We run all our intranet landing pages from it so as we migrate intranets over to the new site, the old ones will still be being used. We have a feature set up where a user can create a list of links that they use frequently and we show them on the home page. My thought was, the easiest way show them would be to just connect to the old DB for the time being and let that feature live on the old site, once the new intranet is up and going fully, we would migrate that feature over. Hope that makes sense.

0 votesVote for this answer Mark as a Correct answer

Dmitry Bastron answered on September 28, 2021 07:06

Ok, it makes sense now. In this case, I'd say it doesn't matter too much how you are accessing this data then as from the solution's perspective you are just reading the data from a third-party database. If you find it easy to work with EF - that's perfectly fine. However, when you migrate this data eventually to your new instance of Kentico, I'd access it with the standard Kentico API.

0 votesVote for this answer Mark as a Correct answer

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