How to recover deleted projects and organizations in Azure DevOps - azure-devops

In case a project and organization got deleted by mistake, How to recover deleted project and organization in Azure DevOps?

If your project or organization is deleted within 28 days, you can recover it in a few steps.
For organization, I advise you to check Microsoft documentation.
For projects, it is very simple, regarding Microsoft documentation.
Click on Organization settings
Click overview and there is a category called Recently deleted projects with a list of projects that you can recover.
Enjoy.

Related

Azure DevOps project level build service does not come visible on old projects

I have one older project in my Azure DevOps organisation that does not have this "project Build Service" account in Project Settings=>Repos=>Security. If I create a new project in my organisation then I can get it there just fine.
How could I get that project Build Service account to my older projects as well?
How could I get that project Build Service account to my older projects as well?
I am afraid there is out of box way to get that project Build Service account to your older projects.
As workaround, you could add a group for that project Build Service account on the Organization Settings->Permissions, add members in that group.
Then, go to Project Settings->Teams->select the Team project-> Add users and/or groups:
After that, we could search that group in the Repos=>Security, do some change in the permission and save it:
Hope this helps.

"Best Practices" doc for Devs reconfiguring Team Explorer when migrating Collection to new server?

I am planning to soon migrate a couple of Collections from a on premises TFS 2017 server to a on premises Azure DevOps 2019 server. These collections have multiple Git repos, no older VSTS style code repos.
I've found all sorts of good documents covering how to migrate the collection- and I am able to do that with ease. I took snapshots of my old and new servers and did a temporary test move over a weekend, everything came up just fine. I then reverted to the snapshots.
Does anyone know of a good document or URL for me to provide as instructions to my 20+ developers for them to reconfigure their Team Explorer in Visual Studio? The Collections on the old server will be detached, so there's no need for them to continue to have the old server configured. I don't want anyone to have to completely switch to the new server in a way where they lose any git branches that they only have local (not pushed up to the server.)
I myself only use TortoiseGit to interact with the git repos. I can see in my git repos, I go to the .git folder and change the URL in the file named "config" and the repo is switched over painlessly.
Almost all of the devs only use Team Explorer. If anyone knows of a good guide that I can walk them through with to make the switch from within Team Explorer instead of having to edit text files and registry keys, I appreciate it.
Thanks!
If I understand you correctly, you are looking for guides to connect your devs' Team Explorer in Visual Studio to the projects in the new on premises Azure DevOps 2019 server.
You can check the documents provided in Microsoft site Connect from Visual Studio or Team Explorer.
For more detailed steps you can check out this thread.
You can ask your devs to follow the steps in above thread to add the URL of the new server to Team Explorer. Then they can switch to code repo of new server.

Share same private Azure DevOps repo with Azure boards on multiple projects

We have the same enterprise app that we sell to multiple customers. The source for the app is hosted in a private Azure DevOps Repo. But we manage each customer's implementation using a separate project for each customer with it's own work items.
Currently we have no way of linking commits to the Source in the Repo project to work items in the implementation project.
We don't want to have the repo in each implementation since that would be redundant and challenging to keep in sync.
Is there a way to handle this inside DevOps?
Currently we have no way of linking commits to the Source in the Repo
project to work items in the implementation project.
For this issue, when you commit to the source in the Repo project, on the Commit page, you can choose to link to work items in other projects.
Or you can click Add link in the Development field of the work items in other projects.
Then on the Add link page, select the Commit link type, select your source repo, and select the commit you want to link.

Could not delete any project in an on premise Azure Devops

According to Microsoft's document, a project could be deleted from the Overview menu of Project settings. but in my own on premise Azure Devops 2019, there is no Delete button at all.
Does anyone know any solution?
screenshot:
If you are not a member of the Project Administrators group, the Delete project column will not be displayed.
If you want to have permission to delete the project, you need to be added to the Project Administrators group in project settings or Project Collection Administrators group in organization settings.
You can also delete the project in the Projects of organization settings,see if this is feasible.

How do I move an Azure DevOps project to a different organization?

I have got a project in an old org (from VSTS), that I want to move to my new one.
I can't see any options in Azure DevOps on migrating projects, or any information on the interwebs.
Anyone know how to do it?
If you just need to move repos, you can use the built in clone functions:
Go to the Azure Devops source repo -> Files
Click "Clone"
Choose "Generate Git Credentials"
Create the target repo in the target Azure DevOps
Choose "Import a repository"
Use the URL and credentials from Step 3
Done
This is not supported today. But this feature was planned to develop: make it possible to move a Team Project between Team Project Collections
If your Azure Devops project only tracks code versions using a single Git repo, hence no boards, user stories, tasks, pipelines, etc. then you can do the following:
Clone your project repo.
For example with Visual Studio.
You don't need to clone if you already have a local repo.
Destroy the association with the remote.
For this typically, you need to open a command line prompt in the folder that contains the .git database folder, most likely the solution folder of Visual Studio and type git remote rm origin.
Here is an example using git bash showing the content of the solution folder, including the .git database and the *.sln Visual Studio solution file:
Open the solution with Visual Studio if not already done.
It should now show that you have many commits waiting to be pushed to a remote. For illustration purpose, my toy project only have 8 commits in total.
Click the up arrow and choose your new remote, say a brand new Azure DevOps project, in the organization of your choice, then push.
You are now done cloning the project in another organization. If needed, then destroy the project in the old organization to complete the "move" operation.
There are 3 projects that I know of to achieve this.
A paid for option by Ops Hub -
OpsHub Visual Studio Migration Utility
An open source tool that requires making changes to the work item process template - Azure DevOps Migration tools
An lastly an Unofficial but still written by Microsoft tool to create Azure DevOps project templates - Azure DevOps Demo Generator & extractor tool
With the last one (the Demo Generator) you extract the project as a template, then apply it to the new organisation. As it is a tool for demo's there is no support provided and in my experience it works for simple projects but falls over on anything complex.
Expanding on others' answers, this post regards Pipelines.
Azure DevOps API
Migrating nearly all aspects of a project across organizations is doable, but it is a lot of manual work using the Azure DevOps API. The link below shows you all the end points, variables, etc. From there you'll probably want to write a Power Shell script and do a couple test runs to a dummy Organization.
https://learn.microsoft.com/en-us/rest/api/azure/devops/?view=azure-devops-rest-6.1&viewFallbackFrom=azure-devops-rest-6.0
In App options
If you avoid the API, there is no way to migrate pipelines that preserve build or release history, but you can preserve your configurations and processes by going into your Pipelines and selecting View YAML. From here you can either take this away as notes to recreate the GUI steps in your new org/project location, or actually adopt the YAML standard in your git repository.
I do not believe there is a way to migrate pipeline variables outside of the API. However, you can move the variables to Azure Key Vault and change your pipeline settings (YAML) to reference values from key vault. This is not a large amount of effort and is a nice process improvement.
Lastly, if you have any locally installed pipeline agents for releases, you will need to run the Power Shell script for your new organization on the boxes. Very simple 5m step, but right now the Agent Pools are not sharable across organization.
As #Frederic mentioned in his answer, we can actually easily do it with Visual Studio. I have done this without Visual Studio. The steps involved are below.
Add a User to Both Organization
Configure SSH Key
Update the SSH Key in Source DevOps and Clone the Repository
Check out all the Branches and Tags
Update the SSH Key in the Destination DevOps
Remove Old and Add New Origin
Push all the branches
The commands and detailed explanations can be found here.
BTW, if you need to change the entire Devops Organization tied to your personal Tenant (E.g. VS Enterprise Subscription) and move it to new Tenant, you can change the AAD and point it to the new one e.g. your EA Tenant on Azure commercial cloud.
Before you switch your organization directory, make sure the following statements are true:
You're in the Project Collection Administrator group for the
organization.
You're a member or a guest in the source Azure AD and a
member in the destination Azure AD
You have 100 or fewer users in
your source organization. Otherwise you will have to open a support ticket.
You may have to add the users back in destination org if they do not exist becuase they will loose access the moment you switch the AAD.
you could just download as a zip file and then download it to the destination repo