views:

713

answers:

1

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)

+8  A: 

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.

Tim Saunders
Thanks for a great answer. Would you mind share you build script for deploying files?
Niels Bosma
Hi Niels, I've added a link to the visual studio template that we use. This contains an exanple folder structure and example post build events (which you will need to edit). Just store that in SVN and avoid editing code through the umbraco interface!
Tim Saunders
Thanks, very interesting answer. Two things I'm not quite sure of... First, how do you handle document types? Do you just recreate them manually on the production server when migrating? Second, can Umbraco handle it when you add templates just by uploading the new *.master files without adding their nodes to the DB ?
efdee
I have the exact same question as efdee: Can templates be added by just uploading the *.master files, without adding the nodes to the DB?
Clean
I've come across an answer for this. If you're adding new templates you first have to create the template in umbraco cms ui. Thereafter you can simply overwrite the .master pages by copying them into the /masterpages/ folder.
Clean