Umbraco: work 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)

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:

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.