19 February 2014

Using TDS


I wanted to do a quick post about TDS here as I am asked quite often: what is the TDS project in your solution? What is TDS? What can you do with it...
  
In most agencies you will work on projects where the team is not working in a common location. As most of you know TDS is a fantastic tools to be able to sync your databases with other team members. If like us you are working with an offshore model then TDS is awesome: you can keep track on template changes and have all of it through Visual Studio and in Version control. As expected quite a lot of Sitecore people knows about the tool and are not surprised. However, the surprise came when I am adding that I am using TDS to create my .update packages (files and Sitecore Items) for deployment into Internal QA then UAT then Prod. The package install could be automated or manual process, but that is off topic for this post. So it is only then that I realize that some of us did not use this feature from TDS - and maybe I should talk about how to use TDS for Synching content but also generate the Update Packages...

1- Synchronise content:

That is quite simple to do. Once you have created you project in Visual studio, you just need to configure the "Build" Tab to make sure TDS will point at your website. Please refer to the TDS documentation on how to create the project in Visual Studio...


Once this is setup then you will be able to use the different option from the content tree to:
  • Get Item from Sitecore
  • Synchronsie with Sitecore


When Synchronising with Sitecore you will have the following screen where you will be able to either update your sitecore instance or update the Solution file.


That will allow you to work on your task then update the solution then checkin + get the latest work from someone else and update your sitecore instance. That is awesome: all templates, layouts... are now in TDS

2- Update Packages

Now the fun starts:
You have been working on your task, as well as other developers on different area of your application. Everything looks good, everyone has been using TDS correctly and checking in their code and Sitecore items... Well it is time to deploy to TEST. I am skipping the debate of automated or manual process for later. So for the sake of this post Let say I will deploy manually. So I am pretty sure as most of us did it in the past: open the desktop > create package > select what we need... Well if you were working with TDS you could configure the TEST "configuration" so instead of connecting to your test site, yu want to create the update package:

  • Right click on your TDS project and select properties
  • Then switch the Configuration to TEST as per the below:

  • Note that the Build Tab is left empty.
  • Go to the Update Package tab, and start filling in the information for your package:

  • Once setup, if you switch the configuration profile in Visual Studio and Right click on any Sitecore Item in TDS, you will note that none of the "Get Sitecore Item" "Sync with Sitecore" are available. This is because you do not want to connect to a sitecore instance, you just want to generate a package


  •  Now, I can hear you say: Hold on, what will be included in my package? Well the answer is quite simple: what you want to be included. For that, you will need to right click on your TDS project and select "Deployment Property Manager".

This will open up the pane as per the following screen, where you can decide what to include. As a preference, I usually include all my templates, all my layout and renderings but None of the Content Item to make sure those does not get overwritten... Then again, from time to time, I do include some items with the "deploy" property "Once" instead of always. This is to make sure that this item will be created if it does not exist but nothing will happen if it does...


Well the last step is simple: build your TDS project using the TEST profile and ... voila:
You have your update packages on the TDS project (file system...):
  
Once those packages are generated, you can install them manually through the Sitecore update installer: http://mysite/sitecore/admin/updateinstallationwizard.aspx

Or you can look for automate the deployment...

NOTE: There is one thing I did not talked abut on this post is the Config replacement, which I am planning on talking in a later post

15 February 2014

Cleanup database when sitecore is running slow


One of my colleague had an issue today with his sitecore instance running incredibly slow on his conputer. Its was almost unusable. After some quick check on the app pool, log files, indexing and any customisation, I checked the Databases and I could see the Event Queue table was full of data. That was Sitecore 6.5.

So we started to cleanup the database table: History, Publishing Queue, Event Queue.
You can notice that there are agents running on your website that are cleaning up the data, but sometime, the data are getting too big and the agents were timing out... Just for reference, here are the agents definition:

      < agent interval="04:00:00" method="Run" type="Sitecore.Tasks.CleanupHistory">
      < !-- Agent to clean up publishing queue -->
      < agent interval="04:00:00" method="Run" type="Sitecore.Tasks.CleanupPublishQueue, Sitecore.Kernel">
        < daystokeep>30< /daystokeep>
      < /agent>
      < !-- Agent to clean up the event queue -->
      < agent interval="04:00:00" method="Run" type="Sitecore.Tasks.CleanupEventQueue, Sitecore.Kernel">
        < daystokeep>1< /daystokeep>
      < /agent>


You can also refer to the Sitecore Guide for more info.

So this post is just a quick reminder to always check the database status and clean it up sometime when doing development.