Umbraco: working with version control? test/production?
Asked Answered
E

2

29

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)

Egestion answered 28/9, 2009 at 8:3 Comment(0)
H
33

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.

Holmquist answered 28/9, 2009 at 9:35 Comment(5)
Thanks for a great answer. Would you mind share you build script for deploying files?Egestion
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!Holmquist
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 ?Chambless
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?Judge
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.Judge
A
2

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.

Agonize answered 13/12, 2013 at 15:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.