How long it will take to upgrade to TFS2015 with Update1


How long it will take upgrade TFS (Team Foundation Server) for different versions?

Collection Size based on actual data not attachment.

It depends on many things but the most important of them are the version and the collection size, remember the size for some work items attachment, this will not take time but the size that really maters for builds, work items number, version control file and history, this is the main content that take time to upgrade, if we look on the changes from TFS2013 to TFS 2015 , we will find they are huge changes in the DB schema, this because to support the renaming for the team project also as long as the collection DB size increased with project content as mentioned earlier, it will take more time.

TFS Pre Upgrade Tool

Also we can use tool like TfsPreUpgrade tool wich help to reduce the upgrade time but only work for TFS2013.4 or higher and SQL Enterprise edition

TFS requirements and compatibility

Also many people asked me many questions about requirements and compatibility, like.. can we work with old build agent or controller? Can we use VS 2008? And all this kind of question. The following link has all answers.
TFS requirements and compatibility

Details requirements:
Visual Studio 2015 System Requirements

In this post I decided to list and update this list later with some of the TFS upgrade time, versions and the size.

TFS2013.4 to TFS2015.1

The following is example for TFS2015 with update 1 from TFS2013, the collection size was 360GB and the log file was 40GB and it took about 11 hours

TFS2015 update1

TFS2012.4 to TFS2015.1

The following is example for TFS2015 with update 1 from TFS2012 with update 4, the collection size was 40GB and the log file was 5GB and it took about 14 minutes
TFS2012 to TFS2015

Upgrade TFS2015 Update 1 from TFS2012 Update1 error


I was upgrade TFS 2015 update 1 from TFS2012 update 1 and I had a small error as the following:
TF400311: The database connection strings are not valid and cannot be automatically corrected. To fix this problem, use the TFSConfig RemapDBs command-line tool to correct the database connection strings.
Completed VerifyShouldRunRemapDbs: Error

This only happened because I didn’t include the default collection DB as it was not needed by the customer.

TFS2015 Update1 Upgrade error

How to work with Git from command line (Windows)


It’s very important to know the commands behind the UI in Visual Studio, in this post I just explain the basic you need to work with Git from the command line.

The first step is to set the global settings, but first list display what it’s value.

git config –global -l
If there is no settings it will tell you no such a file, if there is data it will be displayed as the following:
git config --global -l

If you open the user folder, you can see that file .getconfig, also if you open the Visual Studio and navigate to global settings you will find that this info has been set too.
.gitconfig

I can also edit this file using VIM
git config --global -e

This will open Unix editor, to quite that window I need to type :q +enter
you can press i to start entering text and save by pressing esc and :wq and enter, this will commit with the message you typed. In your current state, to just come out without committing, you can do :q
git config --global -e edit

If you open the file without a proper exit, it will create a swap file and you can’t open it again smoothly, you just need to delete that swap file or close the file as mention before

.gitconfig.swp

Navigate to the directory you want to use and type:
git init
git clone https://github.com/youraccount/rep

This will copy all files to your local files, try to add new file and then add it using
git add .

Try to see the status using
git status

Commit the changes
git commit -m ” your message”

Change the branch
git checkout branchName

Push changes
git push https://github.com/youraccount/rep

Sync between my GitHub and Visual Studio Online


I needed to sync between my project on GitHub and Visual Studio Online, and to do so I used Git remote which enable to connect to a remote repo and then pull from it and push to the other repo.

First I need to enable Alternate authentication credentials for my account on VSO
Alternate authentication credentials VSO

I open my local repo with Visual Stuido 2015 which is connected to my VSO

I add remote repo by open the command line to that local repo and type:
git remote add github https://github.com/Codeflyers/EC-GitHub
git remote add github

Select the local branch by double click(not from remotes), make sure it’s bold
Select origin branch on Git

You can also use the command line instead of Visual Studio, just type git checkout the needed branch, if you look at the Visual Studio, you will notice it’s also bold
git checkout branch

Now, you can pull from the needed branch for example:
git pull github dev
git pull github
Push to the VSO
git push origin dev
git push origin
I will need to do that with each branch, I can remove the remote repo by type:
git remote remove github

I will keep the remote repo to sync later.

Also I can remote repo to VSO by type:
git remote add vsonline https://codeflyers.visualstudio.com/DefaultCollection/_git/EC-VSO/

How to Upload a Virtual Machine to the Cloud for Microsoft Azure


Recently, I worked with Microsoft Azure to provide better solutions using Visual Stuido 2015 and Team Foundation Server 2015 and Visual Studio Online, here…I will just share my experience about that through a new series which introduce different and random features for Microsoft Azure

  1. How to Upload a Virtual Machine to the Cloud for Microsoft Azure

—————————————————————————————————————–

How to Upload a Virtual Machine to the Cloud in Microsoft Azure

Introduction

Step 1: Check-out the Container created in the Storage

Step 2: Install Azure-PowerShell

Step 3: Upload .Vhd File

Step 4: Check-out uploaded .Vhd File in the Container

Step 5: Create a Disk from a VHD

Step 6: Create a New Virtual Machine using From Gallery Method

Step 7: Connect to Windows Azure Virtual Machine

Conclusion

Introduction

This post will describe how to create and manage a virtual machine (VM) in Microsoft Azure. You will see step by step on how to upload your local virtual machine to Microsoft Azure Cloud and create a fully functional virtual machine on the cloud.

Step 1: Check-out the Container created in the Storage

In order to upload the Virtual Machine you need to have a container inside the storage. If you don’t have that already you would need to create one.

1. From the navigation pane, click on Storage.

2. Click on the storage created <vmsmra> inside which you have created container.

3. Click on the container created for your uploaded VHDs <uploadedvhds>.

1-Container created in the storage to upload virtual machine

Step 2: Install Azure-Powershell

You would need a machine to upload .vhd file. In this case we will use Azure PowerShell. If you don’t have Azure PowerShell, you will need to download it.

1. Use the direct link to download .msi file for Azure-PowerShell.

https://go.microsoft.com/fwlink/?LinkID=279888&clcid=0x409

Note: You can also download it from GitHub.

https://github.com/Azure/azure-powershell

2. Click on the downloaded .msi file to install Azure-PowerShell.

3. Click on the License Agreement check box.

4. Click on Install.

2-Install Azure Powershell (machine) to upload vhd file

Step 3: Upload .Vhd File

When you upload .vhd file, you can place it anywhere within your blob storage.

1. Run Microsoft Azure PowerShell.

2. PowerShell console will open up. Type ‘Add-AzureAccount’ and press enter.

Note: Type ‘help azure’ to get all the cmdlets.

3. You will be prompted to sign in to your Microsoft account. Type your email address and password then press enter.

3-Upload vhd file by running microsoft azure powershell

4. Type a command with the following syntax and press enter:

Add-AzureVhd [ -Destination ] <url> [ -LocalFilePath ] <FileInfo>

Where:

· Add-AzureVhd cmdlet allows you to upload on-premises virtual hard disks (in .vhd file format) to a blob storage account as fixed virtual hard disks.

· -Destination <url> specifies the URL of a blob in Blob Storage. The parameter supports SAS URL, although patching scenarios destination cannot be an SAS URL.

· -LocalFilePath <FileInfo> specifies the path to the local .vhd file.

In our case we will type:

Add-AzureVhd –Destination https://vmsmra.blob.core.windows.net/uploadedvhds/vsalm.vhd -LocalFilePath “E:\VisualStudio2013 Update3 ALM\WMIv2\Virtual Hard Disks\2012R2Eval.vhd”

4-Upload vhd file by running microsoft azure powershell (2)

5. It would calculate MD5 Hash, detect empty blocksthen upload vhd file. The total elapsed time can be around 1.5 hours, of course it depends on your internet speed and the size of the VHD.

5-Upload vhd file by running microsoft azure powershell (3)

Step 4: Check-out uploaded .Vhd File in the Container

The uploaded .vhd file would be saved in the designated container inside the storage.

1. From the navigation pane, click on Storage.

2. Click on the storage <vmsmra>.

3. Click on the container <uploadedvhds> to view uploaded VHDs.

4. You can now view your uploaded vhd <vsalm.vhd>.

6-Uploaded vhd in the container

Step 5: Create a Disk from a VHD

After you transfer .vhd file from your local machine to the container in Microsoft Azure, you must create a disk.

1. From the Azure classic portal, under All Items, click on Virtual Machines.

2. Under Virtual Machines, click on Disks.

3. From the command bar at the bottom of the Portal screen, click on Create.

4. A pop up window <Create a disk from a VHD> will be displayed. In Name field, type a unique disk name. In this case we have named it VSALMDisk.

5. In VHD URL field, click on the folder icon.

7-Create a disk from vhd from Azure classic portal

6. Browse to the container location. Click on vmsmra.

7. From the containers within vmsmra, click on uploadedvhds.

8. Click on uploaded vhd <vsalm.vhd>.

9. Click on Open.

8-Create a disk from vhd from Azure classic portal (2)

10. Click on The VHD contains an operating system check box.

Note: In Operating System Family, select your OS. In this case we will select Windows.

11. Click on check mark.

9-Create a disk from vhd from Azure classic portal (3)

12. After few minutes, it will show up the notification that the disk has been successfully created.

13. You can then see the disk created <VSALMDisk> in the list of disks.

10-Create a disk from vhd from Azure classic portal (4)

Step 6: Create a New Virtual Machine using From Gallery Method

The Microsoft Azure Portal provides two basic methods to create a new virtual machine: Quick Create and From Gallery. In this case we will use From Gallery Method.

1. Under Virtual Machines, click on Instances.

2. From the command bar at the bottom of the Portal screen, click on New.

3. A pop up window will open up. Under Virtual Machine options, click on From Gallery.

11-Create virtual machine from microsoft azure portal

4. On the Choose an Image page, click on My Disks.

5. Click on the disk you created <VSALMDisk>.

6. Click on proceed arrow icon.

12-Create virtual machine from microsoft azure portal and choose an image

7. On the first Virtual Machine Configuration page, specify the name for the virtual machine in Virtual Machine Name field. In this case we have used VSALM-mra.

Note: In Tier field, make sure Standard is selected.

8. Under the Size field, select D2 (2 cores, 7 GB memory).

9. Click on proceed arrow icon.

13-Create virtual machine from microsoft azure portal and set virtual machine configuration

10. On the second Virtual Machine Configuration page, set the following virtual machine attributes as shown in figure.

· Cloud Service – This is a cloud service container for virtual machines that you create. You can create a new cloud service container for a single virtual machine or place multiple virtual machines in the same cloud service for load balancing.

· Cloud Service DNS Name – This is the global DNS name that is used to contact the virtual machine.

· Region/Affinity Group/Virtual Network – This is the Region where you want the virtual machine resources to be physically deployed. The Affinity Group attribute allows Azure to keep all services in a group physically close. The Virtual Network attribute allows you to define the network to connect to the virtual machine.

· Availability Set – This is used to define a group of virtual machines that are deployed across fault and update domains.

· Endpoints – These are the communication ports through which the virtual machine can be contacted.

11. Click on proceed arrow icon.

14-Create virtual machine from microsoft azure portal and set virtual machine configuration (2)

12. On the third Virtual Machine Configuration page, set the following virtual machine attributes as shown in figure.

· VM Agent – The VM Agent installs extensions that enhance the interaction with the virtual machine. This option cannot be disabled when installing a Linux image. For Windows data disks and Linux images and disks, a version of the VM agent that supports extensions must already be installed in the operating system.

· Configuration Extensions – These are extensions that enhance the management of the virtual machine, including the execution of custom scripts.

· Security Extensions – These are extensions that enhance the security of the virtual machine, such as antivirus support.

13. Click on check mark.

15-Create virtual machine from microsoft azure portal and set virtual machine configuration

14. You can see near the command bar at the bottom left of the Portal screen, the Virtual Machinebeing created. It will first create the virtual machine, provision the virtual machine and then install extensions in the virtual machine.

15. After few minutes, it will show up the notification that the virtual machine has been successfully started.

16. You can then see the new virtual machine created <VSALM-mra> in the list of VM Instances.

16-Create virtual machine from microsoft azure portal (2)

Step 7: Connect to Windows Azure Virtual Machine

In the Azure classic portal, you use the Connect button to start a Remote Desktop session and log on to a Windows VM.

1. From the navigation pane, click on Virtual Machines.

2. Under Virtual Machines, click on the name of the virtual machine<VSALM-mra>.

3. From the command bar at the bottom of the Portal screen, click on Connect.

4. Click on OK. It creates and downloads a Remote Desktop Protocol file (.rdp file).

17-Connect to windows azure virtual machine by downloading rdp file

5. Open downloaded .rdp file from your local machine.

6. In the Windows Security window, type the credentials for an account on the virtual machine.

7. Click on OK.

18-Connect to windows azure virtual machine by downloading rdp file (2)

8. You can now access the machine of Brian Keller that you uploaded in Windows Azure.

19-Connect to Brian Keller windows azure virtual machine

Conclusion

The Microsoft Azure Portal provides multiple, simple methods to create and manage virtual machines in the Microsoft public cloud. Using the Quick Create method, you can quickly create new virtual machines and go back later to set more configuration options. Using the From Gallery method, you can fully customize the virtual machine configuration before it is deployed into the physical region as a standalone or load balanced service. Microsoft Azure virtual machines scale in processor, memory, and storage, allowing you to create virtual machines with a large number of cores and memory, and data disks up to 1 TB in size. As an added benefit, you can easily move a virtual machine created in Microsoft Azure to Hyper-V and back since both use the same virtualized hardware and VHD format. This allows you to quickly reconfigure services on premise or redeploy to the public cloud to adjust to changing business conditions.

Microsoft Visual Studio Team Foundation Server 2015 Process Editor errors


As we know that Visual Stuido 2015 and Team Foundation Server 2015 has been released, when I started working with the new TFS Power Tool, I found that there are some errors comes with the Process Editor tool.

If we try to customize some types of the work-items, we might see the following error:
Control ” references a non-existing field System.ID.
non-existing field System.ID

We just need to change the name of the control to the right one with the small letters as the following:
Wrok-Item System.id

Another error:
VS402479: You can’t overwrite the Scrum process template, because it’s locked. For more information about customizing process templates, click ‘Help’.
VS402479 You can't overwrite the Scrum process template, because it's locked. For more information about customizing process templates, click Help.

We just need to generate GUID and add it to the ProcessTempalte.xml file as the following:
GUID for TFS Process Template

Another error that Reason field is read only for the Product Backlog Item, so no matter what you added extra reasons, it wouldn’t appear, to fix that we just need to change that to false, see the following image:
ProductBacklogItem layout