Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Umbraco: working with version control? test/production?

I'm looking into using Umbraco for my site and so far I'm loving it.

One big question that I have is how can I version control an Umbraco site as a lot of the data is in the database?

How do you setup a test/dev environment and deploy to production in a streamlined way?

Today (without Umbraco) I used SVN. with different copies of the database for test and production.

The site I building is basically a personal ads site with a complete backend. Would it make sence to keep umbraco tables in a sepparate database and keep my business data in another? (accessed by bunch of user controls)

like image 568
Niels Bosma Avatar asked Sep 28 '09 08:09

Niels Bosma


2 Answers

This is a common hurdle when starting to work with Umbraco and the answer is to use what works for you.

However there have been many discussions on Umbraco forums about this very thing, take a look here:

http://our.umbraco.org/forum/core/general/3619-Source-control-and-multiple-developers http://our.umbraco.org/forum/getting-started/installing-umbraco/2918-Update-an-Umbraco-website?p=0#comment11311

The key thing to consider is the delineation of content and code. Most code in umbraco is stored externally to the DB and as such can be stored in subversion or any other source control platform. For example, templates, XSLT, CSS, XSLT extensions etc are all stored on the file system.

Page content and site structure are stored in the DB.

There are some grey areas, most notably the dictionary which can contain all sorts of things as well as content.

The way we work with Umbraco is as follows:

We have a separate Visual Studio Web Project which contains folders for templates, XSLT, CSS, event handlers, user controls etc. This is stored in SVN. Then on build of this project the files are copied over or compiled and copied over to our test/dev server instance of the umbraco site.

Once the changes are approved we just copy the files up.

If you need to sync the content between Umbraco instances you can either use Umbraco Pro (which includes a component called Courier, which is precisely for this purpose) or back up your live DB and restore into your dev environment when needed (or even use replication).

We mostly try and avoid editing content in the test/dev environment as this is where merging the content back up to the live site can get tricky. However sometimes this is unavoidable. We also try and avoid editing templates etc through the Umbraco interface.

The answer to your final question, "should I store my business data in another DB", is rather tricky as it depends very much on what you are going to do with the data. If it is content that would be best stored in the CMS store it in the CMS, however if it's heavily relational data that doesn't really fit in a CMS then store it separately.

We are undertaking a project currently where data is stored in an external DB and we have integrated an application directly into the Umbraco backend. This was a non-trivial task (although just grabbing some data via user controls is easy) and you should consider carefully the level of effort required to store your data externally vs the inbuilt functionality of the CMS and the budget/time you have to play with.

If you want to use the visual studio template we do then you can download it from our website.

like image 177
Tim Avatar answered Oct 16 '22 16:10

Tim


I know this has already been answered but I just wanted to highlight the fact that a lot of headway has been made with regards to content and code synchronizing. For example - uSync and uSiteBuilder are both great looking packages that allow CMS content such as document types and data types to be controlled using code, and therefore version controlled. They are fairly straightforward to use, although of course please do take backups before using these. Media is usually backed up using something like Export Media although usually it is not a good idea to have your media folder in SVN from its default location. Instead put it in its own branch and host it in IIS as a virtual directory. This way your media is independent of the code.

There is a long way to go with most modern CMS' to have solutions that work well with version control, although there are many things under way. Umbraco is a great CMS and has a huge community.

like image 2
csharpforevermore Avatar answered Oct 16 '22 16:10

csharpforevermore