Firstly, I apologise for the sheer size of this question as I'm sure what I am proposing is a "big deal" in terms of implementing and probably could be three or four separate questions in itself. I wouldn't ask if I weren't in desperate need of help.
I have been given the monumental task of revising my company's risk management procedures in regards to our online work.
As we take no backups, nor protect our data I have decided that, like anyone involved in professional programming should already be doing, we were going to protect our work through source control. I currently do this on a local basis with Git, but others use no source control and ultimately we lose a lot of the benefits that source control offers. I'd rather us have a system where everyone uses Git and have it enforce the rule that if it's not in source control, it doesn't stay. Obviously, we're going to need a backup plan, but as a developer I suppose the first thing to do is to sort out the coding aspect of things before getting a backup solution sorted - obviously, any advice on that too is more than welcome.
We run a ASP.NET website with a SQL Server 2005 backend, running Sitecore as our CMS of choice. In an ideal world I would like to have all the changing parts of this CMS site under source control, including the database.
At the moment, and I know this isn't the greatest idea, I run one solution for ALL sublayouts built in Sitecore. This is under source control and thanks to Git I've been able to add branches and push new features and fix bugs easily (using Git-flow as my workflow solution). I'm still quite new to Git though, so I've not managed anything too complex outside of committing, ignoring certain files, etc.
On top of this, I would also like to use source control to get the database contents under source control. As I understand it, you can serialise Sitecore content items as a huge tree within the file system (saved as .item files if I remember correctly?). If this is the ideal solution I would also like to add these to source control, although I don't know exactly where they would be saved on the file system. My file system right now is like this:
- Data (Logs, indexes, etc - is this needed to be in source control?)
- Source (Helper files, although occasionally modified)
- Website (Containing all the files I edit, and other essential Sitecore stuff)
As mentioned already my current repository is only on my system, and it consists of a single solution folder with a bunch of .ascx, .ascx.cs, .ascx.cs.designer and the odd .aspx file or two. This tends to make my life easier when uploading as, like with the
What I would like input on is an ideal way of managing this for all developers. Despite using a DVCS I would prefer to have the live server viewed as the main repository and for all the other developers to push and pull from it, and each other. We'll be using the git-flow workflow solution as it conforms to our way of development nicely. What I'm worried about, obviously, is setting this up correctly without destroying what's currently a very expensive, high-traffic site on a server with no backup.
Tips and advice on how much of the data on the server to stick in the repository, guidance on how to handle the serialised data in Sitecore and potentially how to use the source control itself as a way of backing up to a separate repository would be welcomed. This is the first time I've had to build a source control system/workflow for a live website, so any guidance and advice on what would be the best thing for me to do would be much appreciated.
EDIT: I am going to put a bounty on this to try and get more guides on how people handle Sitecore with Git.
To clarify myself, I am NOT looking for a way to back up my work, rather a way so that a number of developers can work on it and ensure that the code on the website is up to date with a central repository. For example, I have referenced before that I will be using git-flow to manage my workflow. The origin repo will exist on a shared server (which in time will likely be a test environment), and all developers will have clones of that to work on and to push to. From here, I want to be able to push changes from the origin repo on the shared drive to the live server and back again if errors are found. I would also like to include serialised content items in my repo.