Database under version control (Sitecore)
I have just read the following post on SO;
Do you source control your databases
We are working with Sitecore and normally Attach 3 standard databases 开发者_开发知识库to our MSSQL server. We have a Core , Master and Web database. In the proces of developing the different templates on the backend of Sitecore we all use one database and just publish our database changes using Sitecore CMS. When for example I create a datatemplate, my collegue will see the same datatemplate appear when he refreshes his "content tree". From what I've read in the post linked above Database Source control is needed when you have multiple versions of source code with different databases. Is it needed to bring our databases under source control? Looking at this knowing that Sitecore is actually handling the publication of items to the different databases etc, and we all work on the same database through Sitecore CMS, I think this won't be needed. I'm curious if there would be any advantage of still putting the databases under version control.
Sitecore 6 introduced very cool feature called Item Serialization. No need to keep your entire database files under source control. You can store just the serialized versions of necessary items. Those are simple text files on your file system.
Take a look at this blog post from Alex for more details.
The post you link to, and subsequent posts, are more appropriate for custom applications where you "own" the database. i.e. You've created the tables, stored procedures, views, etc... I would agree that if you did create a database then your schema needs to be in your source control. However, in the case of a Sitecore web site you do not "own" the Sitecore database schema and therefore you should not have to have it in your source control. (I would hope that Sitecore has the schema in source control though ;p)
So, you don't own the actual database schema and shouldn't have it in source control, but what about the templates, and other items, you created for your Sitecore web site?
For Sitecore items in your solution, you need to have a clear understanding of the ownership of them. The items, and templates, that ship with Sitecore are not owned by you and therefore you shouldn't manage them in your source control system. However the templates you, and your team, create should be in source control!
In order to get specific Sitecore items into Source control you can use the built in serialization features of Sitecore as Yan had mentioned. You can also use a tool like Team Development for Sitecore to automate this process and help with doing automated builds and deployments of your items between environments.
精彩评论