Installation and deployment Questions on installation, system configuration and deployment to the live server.
Version 5.x > Installation and deployment > Database connection across dev-stage-prod model View modes: 
User avatar
Member
Member
kong-gc.cuny - 6/26/2011 10:53:09 PM
   
Database connection across dev-stage-prod model
Hi folks... I was hoping to get some thoughts on best practices for dealing with deployment and version control methods in a dev-stage-prod model.

We are using GIT for version control but I realize that because of our model and that our 3 databases actually only live on 2 physical servers (stage/prod are on the same server) I'm having a problem... if I point DEV web.config to DEV DB, it may get commited/pushed/pulled to staging server in which case then Staging will end up pointing to DEV ... same problem with Prod and vice versa as well.

So what do you folks do? I was thinking old school and wondering if using a System DSN connection string would be preferably, than I could have a set DSN on each server and have the pointer named the same so regardless which server you were on it would all work well.. but I'm not sure this is the best approach.

Any comments or thoughts out there on this?

User avatar
Member
Member
lancetek - 6/27/2011 1:20:27 AM
   
RE:Database connection across dev-stage-prod model
Microsoft suggests that you use web.config transformations for deployment changes to your web.config.

But seening as you're using Git, I'm speculating that you don't deploy using the MS deployment method.

If you're just copying the files from a repository, I'm afraid you'll always have some manual commenting/uncommenting to do in the web.config. Of course you could write your own transformation (or find 'n replace') job.

But best practices stipulate that you have each applictation running in it's own app pool. If you each app pool is running under it's own user (such as the Application Pool Identities), they you don't really have a problem with deployment looking at the incorrect database, no matter what server they are on. ('cause you'll get a big, fat, "this db can't be read by this user" error if you try to run without correcting the connectionstrings)

i.e: Your staging and prod may be on the same db server, but they shouldn't be using the same database, so just make a Kentico user for each. You can be primitive old Skool about it and have to comment or change the connectionstring settings manually, or you could work some sort of transformation process into your deployment to make things a bit smoother/automated.

Lance

User avatar
Member
Member
kong-gc.cuny - 6/29/2011 6:17:03 PM
   
RE:Database connection across dev-stage-prod model
Thanks for the feedback...

I dived further into GIT and decided that I could actually create a branch per server (Dev, Stage & Prod) and since I can control what my developers do, I can cherry pick my commits from my DEV branch into my Staging branch which should preserve my web.config file ... at which point I haven't really thought of what to do with the Prod branch but I'm guessing I can also cherry pick my updates... or I'll need to do something a bit more ..

Still sort of new to GIT as well so I'm not sure what the best option here is.. maybe the same technique.. we'll see..

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 7/7/2011 8:16:22 AM
   
RE:Database connection across dev-stage-prod model
Hi,

Thanks for valuable comments and suggestions. I'm trying to get a word on this from our developers, hopefully I'll add our oppinion soon.

Thanks again,

--Zdenek