Installation and deployment Questions on installation, system configuration and deployment to the live server.
Version 6.x > Installation and deployment > Source Control and Kentico CMS View modes: 
User avatar
Kentico MVP
Kentico MVP
Brenden Kehren - 8/20/2012 12:41:52 PM
   
Source Control and Kentico CMS
Looks like this has been discussed somewhat before but didn't really find what I was looking for so thought I'd ask again.

1). Any recommendations for keeping Kentico CMS in source control?

2). Any recommendations for updating test, staging, production servers using KIM and source control?

Currently using SVN and it works very well with our other website applications and projects. We have a business rule in place to publish from local to test, test to staging and staging to production and would very much like to keep that in place although the process itself may need to change.

My thought is to register my local setup with KIM, install and create db locally. Then do the same with test, staging and production environments. Bad part is when I run a hotfix or update to my local machine and check it in to source control, it's not the same version that will be published on the test, staging or live servers if I'm updating those instances through KIM.

Maybe I'm thinking way too much (or not enough) but just looking for a somewhat simple solution that works and works well.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 8/22/2012 2:16:07 AM
   
RE:Source Control and Kentico CMS
Hi,

It depends what kind of customizations are you doing.

1. If you are just creating custom web parts, controls, page templates then it is good to have them in a separate folder and use source control only for these files.
2. If you are also modifying the default Kentico files, the best way is to checkout all the files, apply hotfix and then check them back into the source control.

Best regards,
Juraj Ondrus

User avatar
Kentico MVP
Kentico MVP
Brenden Kehren - 8/24/2012 9:24:51 AM
   
RE:Source Control and Kentico CMS
Thanks Juraj!

I've just placed everything in source control and have excluded a few folders where dynamic content gets created (log files, index files, etc.) Seems to be working very well.

In regards to my second question, when I perform a hotfix update I can do this without error on my local machine but how will I go about updating a remote instance? Say my local machine has the all the website files and a local database. The remote test environment has a server (either FTP or UNC path) and a remote database (either local network, not my local machine, or accesible via https). This is very common for development environments as I'm sure you know. Do I have to perform the manual update to those and if so, can you point me in the right direction on how to do that? I've always used the KIM and it's worked great but end up manually coping files over and can take hours on FTP.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 8/24/2012 11:45:44 AM
   
RE:Source Control and Kentico CMS
Hi,

In this case you need to download the hotfix self extracting file from here or, if you already used KIM to install the HF on a local CMS, you can find the hotfix file either in the hidden folder C:\ProgramData\KIM or in the Kentico CMS install folder in Program files. Open the instructions PDF document and there is a chapter about manual hotfix deployment to the remote machine.

Best regards,
Juraj Ondrus

User avatar
Member
Member
@davey_lad - 11/2/2012 6:07:10 AM
   
RE:Source Control and Kentico CMS
Just came across your post as I'm now scratching my head thinking about a good source control strategy for Kentico... and i'm not sure there is one. Particulary with it's various development modes and the ability to mix them.

I was wondering if you could post or send the list of items you have included and/or excluded for SCC. Has your strategy evolved since this post?

I'm going to be using Team Foundation Service and will probably be setting up a continuous build service. Makes me wonder if I should to switch to a Web Application project as opposed to Website project. The ridiculous build time for Kentico put me off however (even on my nuclear powered machine).


User avatar
Kentico MVP
Kentico MVP
Brenden Kehren - 11/2/2012 7:29:33 AM
   
RE:Source Control and Kentico CMS
@davey_lad

What I have setup is the whole website (not project) setup in SVN. This way I can perform updates with the KIM tool and save those to version control as well. Seems to work pretty well. We do have a build server setup (CruiseControl .NET from ThoughtWorks) and haven't had any problems. We actually have several projects setup in the CC and each project has multiple websites/webprojects and they build fairly quick. (5-15 mins) TFS is a good tool although we weren't fond of it because of the high overhead and it always seemed there was something not working right so we opted out of it and use SVN and CC.NET and have several departments using it (BI, Network Support for their scripts, and development).

In regards to your machine, do you have a solid state drive? If not, get one, you will notice a huge difference. My co-worker has one on his machine and it cut the build time (locally) down more than half.

User avatar
Member
Member
@davey_lad - 11/2/2012 9:45:53 AM
   
RE:Source Control and Kentico CMS
No SSD drive unfortunately, but I do have a pretty fast raptor. I think even 5 mins is a long time to wait for a build operation to be honest.

We're not using a traditional TF Server setup (in-house) but rather trialling TF Service (http://tfs.visualstudio.com/). It's free for now and only time will tell if future pricing makes it viable long term.

I like the fact we don't need to worry about the infrastructure or management of it.. plus it supports build services. Importantly for us it also has deep Visual Studio integration.


User avatar
Kentico MVP
Kentico MVP
Brenden Kehren - 11/2/2012 9:55:13 AM
   
RE:Source Control and Kentico CMS
RE: build times, I compare Kentico to our home grown asp.net 3.5 website and some other solutions (DNN, Ecktron, AspDotNet Storefront) and by far Kentico's build time is faster than any of them. And if you think of the build process is happening, <= 5mins is pretty good.

RE: source control, TFS is a good tool for some of the things you mention although there are limitations (could be my lack of knowledge too) that cause it to not work well when trying to use it outside of Visual Studio. As far as price if you have an Visual Studio MSDN subscription, I believe it is included with your license but if not, it could cost you! I hear GIT is great to work with (although my experience has been minimal).

User avatar
Certified Developer v6
Certified Developer v6
Nortech - 1/29/2013 5:41:08 AM
   
RE:Source Control and Kentico CMS
I've decided to revive this old thread instead of adding a new one.

We've been using git and I have some concerns about which folders/files should be ignored form the repository. I am especially concerned about the app_data folders and files. Which ones should be excluded from the repository?

Do you have an ignore list?

As for the different web.config files on the local/staging, in git you can exclude a file from tracking but still have it in the repository (git update-index --assume-unchanged <filename>). This way there is a default web.config in the repository which anyone can then modify it locally. Since git is not tracking the file, it does not get pushed to the remote repository.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 1/30/2013 1:31:49 AM
   
RE:Source Control and Kentico CMS
Hi,

There is no ignore list in general - we do not know which files and where you want to modify. So, if you will have rule that files in XYZ folder will not be changed, you can exclude that folder. But you ened to take into account also the option, if those are systme files, they can be changed after applying a hotfix.

Best regards,
Juraj Ondrus

User avatar
Certified Developer v6
Certified Developer v6
Nortech - 2/1/2013 12:30:17 PM
   
RE:Source Control and Kentico CMS
Hello Jurano and thanks for answering.

Is it safe to exclude app_data/persistent folder from source control? I mean you would not need to publish the files contained in that folder on a production server, would you?

User avatar
Kentico MVP
Kentico MVP
Brenden Kehren - 2/1/2013 12:38:43 PM
   
RE:Source Control and Kentico CMS
I do not include the files in that folder or anything inside the CMSTemp folder in version control and things work perfect.

As far as keeping the website in version control, we opted to keep the whole website (with some exclusions) which allows us to make changes to anything we'd like and have the ability to roll back a hotfix if needed. So far so good!

User avatar
Member
Member
rlull - 8/9/2013 10:45:33 AM
   
RE:Source Control and Kentico CMS
Hello - we are working through this process for the first time and I saw this post. We are using Git for our repository. Just thinking, in addition to ignoring App_Data/Persistent and App_Data/CMSTemp, can I also ignore the bin and obj folders?

User avatar
Kentico MVP
Kentico MVP
Brenden Kehren - 8/9/2013 11:11:35 AM
   
RE:Source Control and Kentico CMS
I include them simply because when I use the KIM to update the site with a hotfix or upgrade, I will then have a proper running version of Kentico in my repo. If you excluded the BIN directory and kept all the other directories, it could cause breaking changes with some of the controls if the dlls aren't up to date.

User avatar
Member
Member
rlull - 8/9/2013 11:20:25 AM
   
RE:Source Control and Kentico CMS
Great, thanks for the clarification.

User avatar
Certified Developer 13
Certified Developer 13
jay@3degreesnorth.com.au - 9/24/2013 3:15:55 AM
   
RE:Source Control and Kentico CMS
I've been trying out different methods recently (assemble svn and team foundation server) with a view to coming up with a process of development, source control and eventually distribution.

We find that most of our website projects need files added to:
- webreferences
- app_themes/custom folder name here
- app_code/custom folder name here
- cmswabparts/custom folder name here

Generally the rest of the kentico file system is the same from customer to customer and to be honest I don't want to put it all into source control.

I don't see a way to be able to put everything we need (webparts, class files, css/images, webservice references) in one folder and then just put that one folder in source control.

We also work in a distributed dev environment - so each developer is developing locally and using their own kentico DB and local IIS and then exporting - importing to a testing server.

It's getting really messy - someone needs to write a book or whitepaper on how to do this properly.

Jay

User avatar
Kentico MVP
Kentico MVP
Brenden Kehren - 9/24/2013 8:28:29 AM
   
RE:Source Control and Kentico CMS
jay@3degreesnorth.com.au wrote: It's getting really messy - someone needs to write a book or whitepaper on how to do this properly.
Jay, if you read all the posts, there is some good discussion as to how I and others have set things up. It's not set in stone but sure is a great resource.

Think about this from the client side. When you put all the files in source control you have their instance of the website versioned. You start another client project (assuming with another Kentico code base and probably different minor version) so now you have their website versioned. Although many of the base files don't and probably won't change its still a good practice to have client's source code saved off somewhere else.

Now think about this from the developer standpoint. If you simply checked in 4 or 5 root folders and never checked in any dll's, other controls or pages, how would a new developer ever get the site to function if they can't check out the full site?

You might also rethink using a local database for each developer. I'd seriously consider a remote or VPN solution for your developers to access the database vs. local copies. Local database copies = your solution. I highly suggest using their own local copy of code.

User avatar
Certified Developer 13
Certified Developer 13
jay@3degreesnorth.com.au - 9/24/2013 7:08:55 PM
   
RE:Source Control and Kentico CMS
@FroggEye - you make some good points.
When you put all the files in source control you have their instance of the website versioned.

How about speed though. Currently using assembla and checking in/out the whole site takes ages. Do you host your own SVN or source control system?
If you simply checked in 4 or 5 root folders and never checked in any dll's, other controls or pages, how would a new developer ever get the site to function if they can't check out the full site?

I was thinking that they would do a standard kentico install - then check out the pieces they need into that project rather than the whole thing.
I'd seriously consider a remote or VPN solution for your developers to access the database vs. local copies.

You're right here - this is a good idea. We have the VPN for the webservices we use for CRM integration - not much difference for the DB i guess.

Thanks for your comments.

J

User avatar
Kentico MVP
Kentico MVP
Brenden Kehren - 9/24/2013 8:49:48 PM
   
RE:Source Control and Kentico CMS
Jay,

In regards to your source control, I'm not a big fan of Assembla. I currently work locally with SVN and hosted with BitBucket and SVN Repo. Both hosted solutions are great and I have no problems with them at all.

In regards to check in/out, you might look at what Kentico offers for versioning and development. Take a look in Site Manger>Administration>System>Virtual objects>Source control. You can check files in and out of the file system and commit them to a remote database as well as source control. Kind of a double whammy and it works pretty good too!

Regarding doing a "standard Kentico install", is there such a thing? Download v7 and apply the hotfixes or not...now what version do you have checked in to your repo? Will they be compatible? If you do a simple install and don't install all the extra templates, sample sites, etc, then you can get a pretty small install footprint to place in your repo.

Good luck!
Brenden

User avatar
Certified Developer v7
Certified  Developer v7
ianwright - 1/20/2014 9:58:13 AM
   
RE:Source Control and Kentico CMS
Has anyone looked at trying to version the Kentico database at all?

User avatar
Kentico MVP
Kentico MVP
Brenden Kehren - 1/20/2014 10:35:44 AM
   
RE:Source Control and Kentico CMS
ianwright wrote: Has anyone looked at trying to version the Kentico database at all?
I am planning on doing this soon with a tool called Red Gate. From what I've tested and read, there should be no problems, it's just a matter of what you want to version since so much data is changed on a regular basis.

User avatar
Member
Member
bdrenner-new42 - 2/18/2014 4:45:35 PM
   
RE:Source Control and Kentico CMS
I've been playing with the export / import features, and it made me think about this: An export package appears to be a zipped folder structure in which documents and metadata are serialized to text files (XML). I could imagine keeping an unzipped export-package in version control. Has anyone had luck with this strategy?

If this works for keeping content in version control, then I would like to build a "regenerate" script to automate reviving the Kentico instance and all its data from a freshly cloned repository.

User avatar
Kentico MVP
Kentico MVP
Brenden Kehren - 2/18/2014 7:12:28 PM
   
RE:Source Control and Kentico CMS
@BDRENNER-NEW42,

Why store an unzipped package in source control? Kentico's default methods and such use it as a zip file so why not just check that package into version control and save it?

Secondly, don't you have a database backup? This should be enough to store your content. If you have a very large site your export (.zip file) could be upwards of a couple GB in size if not larger.

Just curious as to your need or use for it I guess.