Your Sitecore content changes are just as important as the code you are writing for your solution, and that means you should be tracking those changes in source control. Your team will be making a lot of changes to fields, templates, presentation details, and various other elements for which you will want version history. This is where Team Development for Sitecore (TDS) comes in.
Team Development for Sitecore
Our teams use Team Development for Sitecore from Hedgehog Development to create .NET TDS projects to source control the changes we make in the Sitecore database. There’s a great guide that Hedgehog posted online on how to get started with TDS projects in .NET, but here are the basics of how you get set up:
- Local databases. Each developer has the Sitecore databases (Core, Web, Master, and Analytics) on their own SQL Server instance so that their changes do not affect each other.
- Local IIS websites. Each developer has an IIS website setup on their machine for their Sitecore solution. To make configurations easier, we actually use a setup script to ensure that each developer has the same local name for this site and the same host name entry in their HOSTS file. For example http://MyProjectName.Sprint1. Not a necessity, but it sure does make life easier when sharing links or configuring the TDS projects.
- TDS Software. Each developer needs to install the TDS software on their machines so that they can synchronize with the Sitecore database.
Note: A license is required for each developer that is installing and using the TDS software!
- TDS projects. The .NET solution that everybody is working with needs to have the TDS projects for the Core and Master databases. Depending on the project, you may need one for the Analytics database as well. These projects should be added to your source control just like any other project file.
- TDS Build Configuration. The URL for the site being source-controlled needs to be specified in these projects. To do so, edit the Properties of the TDS projects and open the Build tab. Set the Sitecore Web URL to the host name of the local development IIS site. For example http://MyProjectName.Sprint1.
- Get Sitecore Items. During initial setup, you won’t have any files in your TDS project. You need to set up your source control of Sitecore by right-clicking on the project and using Get Sitecore Items. This will allow you to choose which items you wish to keep source-controlled.
Note: I strongly advise only adding the parts of the Sitecore tree that you intend on changing, as source-controlling the entire Sitecore application will slow down your synchronization and needlessly complicate your source-controlled project with files you will never change.
- Synchronize. As the development team is making changes to the Sitecore database, these changes need to be shared across the team to ensure each team member has up-to-date local Sitecore databases. This requires the developers to synchronize the contents of the source control project with their local databases. To do this, the developers will need to regularly “get latest” on these projects, then right-click on a TDS project and choose Sync with Sitecore. This will compare the contents of the developer’s local Sitecore database with the contents of the TDS project. For each difference, the developer can then choose to move their database changes into the project, move the project changes into their database, or perform a merge.
Reading the Hedgehog guide is a great start, but you will also want to start looking into automating your deployments. I’ll have some upcoming posts about using TDS to automate deployments using TeamCity or TFS.