Team Foundation Server Backup Tool - tfs

I'm using the Team Foundation Server Administration Backup tool to backup my TFS databases. With TFS 2015 the tool seemed to recognize and backup a non-tfs database (SonarQube). Now with TFS 2018, the tool does not recognize this database.
Question, How do I get the Backup tool to recognize a non-tfs database as part of the backup set?
In 2015 the backup setttings xml that the tool generates (BackupSettings.xml) included a tag section that included my non-tfs database e.g.
<Reporting>
<Database Name="ReportServer">CIR-SQL-TFS18</Database>
<Database Name="ReportServerTempDB">CIR-SQL-TFS18</Database>
<Database Name="SonarQube">CIR-SQL-TFS18</Database>
</Reporting>
In TFS2018 the SonarQube tag is not included.
thanks

Related

How to migrate a TFVC project from TFS to AZDO?

How to migrate a TFVC project from TFS to AZDO ?
Goal:
Is to migrate host projects on (TFS 2017) using TFVC, to switch them to Azure DevOps Service (AZDO) using TFVC there too.
My context:
TFS 2017 server version 2 hosting current source projects.
AZDO 2019 service wanting to host projects targeted on TFS.
Context wish:
Keep the history of source projects (TFS) on AZDO services.
I Just want to migrated the projects (TFS) in TFVC to (AZDO) in TFVC, without doing any TFVC -> GIT conversion.
I would like to avoid updating the TFS 2017 server for 2018 then to
the AZDO server to switch to AZDO services afterwards.
You understand
that is a lot of step to just want to switch a project in TFVC on
TFS2017 to a TFVC on AZDO
The easiest way to migrate is to upgrade your TFS2017 server to Azure Devops Server 2019 and then using the full fidelity import feature to upload your whole database backup to Azure Devops Service.
At the moment migration tools support TFS2018u3 as well as Azure Devops Server 2019 and 2019u1 as well as 2020 can be imported into the service. We do these kinds of imports regularly and it's a very straightforward process to restore your TFS server backup to a temporary SQL server, install the correct version of TFS/Ads and have it perform the upgrade in-place during the installation. Then use the migration tools to import the collection into Azure Devops Server. Depending on the size of your collection this may take between a couple of minutes to a couple of hours. I've done the upgrade on my laptop on certain occasions as well, installing Azure Devops Server and SQL Server Developer edition directly on Windows 10. Even a trial versions will do.
For all the details on the. Import process, see:
https://learn.microsoft.com/en-us/azure/devops/migrate/migration-import
If you want to import your tfvc project from one TFS servers to another TFS server/Azure Devops Server, you can detach the project collection on you current TFS server and bacmup/restore the database on another server. It will automatically be upgraded
If your project collection has multiple projects, you can delete the projects you don't need after attaching and upgrading your collection.
There are a few tools to perform a history replay from one server to another, those tools can't import everything, your changes id's will change and you'll lose the exact date a commit was made (and possibly the user who made the commit if that account no longer exists). Tools like:
https://www.opshub.com/products/opshub-visual-studio-migration-utility/
Depending on how old and how big your collection is, it may take many hours to migrate the data. If data has previously been deleted/destroyed or branched across projects or edited during branch operations, then the replay may fail or may be forced to perform alternative actions, some of these operations are no longer supported. I've used opshub on a couple of projects and some it completely failed to migrate, others migrated with incomplete or incorrect data. This was 4 years ago, maybe these were bugs and they were fixed, but since the import tools have been released we've used those almost exclusively.
PS: using tfs-git to convert (part of) your TFVC repo to git would be an alternative which I'd recommend you look into further. TFVC has been declared feature complete and has received very little love in the past few years. It's not supported by the new Multi-stage YAML pipelines, the integration for VS Code has been deprecated, the cross platform commandline tool for tfvc has been deprecated and therefore support for eclipse and rider and intellij as well. Team Explorer in VS 2019 is now pushed to the background with the release of the new git features which have escaped the Team Explorer window. It's clear that TFVC is fighting for a lost cause and that Git is winning, you'll need to switch over at some point.

How to perform code migration from TFS 2018 to Azure DevOps?

We are trying to migrate code from TFS2018 to Azure DevOps. I am new to code migration from TFS to VSTS. I would like to know is there any tool for code migration?
I saw TFS-GIT utility. I am really not sure how much efficient this tool.
GIT-TFS list remote repostiory
You may do it through OpsHub tool: OpsHub Visual Studio Online Migration Utility
My recommendation would be to either upgrade your on-premise server to Azure DevOps Server 2019 or the latest Team Foundation Server 2018 update pack that's supported by the migration tool.
You can perform this upgrade on a clone instance of your existing server, so it won't break or change your existing machine or database in case anything goes wrong.
We regularly perform these types of migrations and we generally use a temporary Azure Virtual Machine. We install SQL Server on it, we restore the backup of the on-premise server, we install the desired TFS application tier version on it. If the Azure machine is joined to your domain, then that's all you need to start the import into Azure DevOps. If the machine isn't domain joined, be sure to turn off the AD Sync job as part of the migration. My colleague Jasper has a couple of scripts to fix that for you.
Alternate options. In my opinion there aren't any. At least not good ones. There is a whole set of tools that an migrate parts of TFS to Azure DevOps, tools like OpsHub, git-tfs, git-tf, Migration Tools for Azure DevOps. None offer a complete migration, some do work items, some sources, some builds, but none of these offer a complete migration.
All of these also have the issue that they reset metadata such as Commit/Approval dates, work item IDs. Which will impact retention jobs, history and other things you may care about.

Clone TFS 2017 to new hardware

We have TFS 2017.2 in 'Prod' and now I have to clone it on new PC to take some tests and so on.
I did DB backups with the help of TFS Scheduled Backup tool (Configuration DB, Collection, Warehouse, ReportServer, and ReportSerfer_tempDB), installed TFS 2017.2 on new PC, restore DBs.
After it I start TFSConfig ChangeServerID /SQLInstance:spbtfs01fortest /DatabaseName:Tfs_Configuration' and 'TFSConfig RemapDBs /DatabaseName:spbtfs01fortest;TFS_Configuration /SQLInstances:spbtfs01fortest and start the Server Configuration Wizard, filled in all and got this:
What wrong with it?
You have to run tfsconfig remapdbs for the analysis services database (with /AnalysisInstance), and for the warehouse database as well for the collection and configuration databases.

team foundation server 2012 restore

I am trying to restore a Team Foundation Server database to another server.
The Original server was a Team Foundation server express 2012 install.
Steps so far
Created backup of all the databases using SQL management studio
i.e. TFS_defaultCollection,TFS_Configuration, Tfs_Company1, TFS_Company2.
Installed TFS Express 2012 on another server
Restored all the SQL Server database's to the new server
I get an error the SQL instance is missing.
Is there any way to restore the TFS databases to the new server.
or
is there any way to extract the project data from the databases.
Make sure you have created the SQL instance in SQL server.
Based on your description your backup should be executed manually. So,to restore data for Team Foundation to a different server or instance, you must complete the procedures that your deployment topology requires the sequence mentioned in below link:
https://www.visualstudio.com/en-us/docs/setup-admin/tfs/admin/backup/restore-data-different-instance#back-up-data
Recommend you follow the steps in this link provided by Daniel to backup and restore the database from TFS Administrtion Console, it's more convenient than manually backup.

Why does "tf history ." claim there is no working folder in my mapped TFS directory?

I am trying to modify my project so that on build it queries for the current TFS changeset for the local directory and uses that to form the build number (using http://florent.clairambault.fr/insert-svn-version-and-build-number-in-your-c-assemblyinfo-file as a reference).
Since we currently are not using team build or any continuous integration for this particular project at this time I plan to use:
tf history . /r /noprompt /stopafter:1 /version:W
However, when I test this command out using the visual studio command prompt in my project's directly (where I work from TFS) it claims:
There is no working folder mapping for xxxxxxxx
The folder is shown as mapped in my workspaces in Visual Studio's Source Control Explorer (shows as the local path), and when I edit my workspace.
Why is the command line utility claiming there is no working folder when it is?
You will see this error message if you are using Visual Studio 2012 (and the corresponding Team Explorer 2012 client) and you are using tf.exe from Team Explorer 2010.
TFS 2010 clients store their local workspace cache in a different location on-disk than TFS 2012 clients. Thus, if you are to create a workspace with a TFS 2012 client, the TFS 2010 client cannot see that workspace data until it has connected to the server and populated its own local client cache.
It sounds like you're okay with using the TFS 2012 version of tf.exe, so I would make sure that your PATH contains an entry to that one first, and this should resolve your problem.
If you really wanted interoperability between the two versions, you would need to make sure to connect to your TFS server from both clients in order to make sure the workspace cache was complete for both. However make sure that you are using only server workspaces in this case, as TFS 2010 cannot connect to a TFS 2012 local workspace.

Resources