You might want to clone your TFS instance if you are doing a hardware move upgrade. There can be other situations such as you need to move one of your projects to VSTS (Team Services) using high fidelity database import, without migrating other projects in the same collection. If you prefer to keep your current TFS untouched while trying to create an isolated collection for a single project, you might want to clone and create an instance of your TFS. There can be several other experimental reasons you may have to clone a TFS instance.
Let’s look at backup options we have.
You can backup TFS after stopping all services and taking manual backups via SQL Management Studio. If you want to keep your TFS running while you take backup, you can use the TFS administration console backup scheduler and trigger a manual backup. First create scheduled backup with manual backup option selected. Then take a backup by manually triggering a full backup.
But if you are taking a backup without stopping TFS services, make sure you have no other backup plans running using SQL server backup devices etc. This is because your backups to be restored should be in time sync etc and it will be done using trn files added to backup set. If any other SQL trn (transaction log) backups happen during the long running TFS backup process you may encounter issues in restoring. make sure to add a report key encryption password and remember it for restoration, in different hardware. The learnings here are also worth having a consideration.
Backup set will not include the Tfs_Analysis backup. To take the analysis database backup connect to Analysis Services via SQL Management Studio and take the backup manually. This database should be rebuilt with the warehouse once the cloning of TFS completed. But this is required to be restored to allow running commands such as prepare clone, which will be explained in next article.
First setup your target machine with same SQL server version of your current TFS database server. Higher version of SQL also works fine. To find out the version and edition of your TFS database SQL server execute below commands in a new query.
Setup the TFS version (exactly current TFS version you have in your current TFS server) in the target clone server. You can find the Current TFS version in Admin console of your current TFS server AT.
You might get the above shown error if you have your new SQL server reporting services configured in native mode. Go to the SQL reporting services and change the database name to something like ReportServer1.
Out of below issues we have to only worry about the reporting services key as we are cloning our TFS environment.
TF400980: Failed to restore the Reporting Services encryption key. You can try using RSKEYMGMT command to restore the encryption key
TF401010: The backup path changed since Scheduled Backups were configured. This may cause future backups to fail. Rerun the Scheduled Backups wizard to update the settings to the new path.
You may need to purge the version control file cache on all TFS ATs and all TFS proxy servers that service the TFS instance prior to putting the TPC back online. For more information, see this KB article http://support.microsoft.com/?kbid=2025763
To get the reporting services working with the restored report services DBs go to change databases in Reporting Services Configuration Manager, and change database. Select the option of use existing database and proceed.
You can safely remove the temporary report server databases created earlier named ReportServer1 and ReportServer1Temp.
In the next post we will look at how to prepare restored databases for cloning the TFS instance.