team foundation server 2012 restore - tfs

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.

Related

TFS SQL Upgrade Error TF400787: The 'DefaultCollection' cannot be started

I setup a 3 tier TFS preprod environment that includes: an application server, a build server and one database server (SQL Server 2016).
I restored SQL Server databases from the production environment to the preprod environment, installed TFS 2017 on the app server, attached the database and tested successfully.
I then upgraded TFS 2017 to TFS2018 and tested successfully. I restored the databases from SQL Server 2016 to SQL Server 2017, updated compatibility mode on the databases to SQL Server 2017, stopped the collection in preprod environment, edited settings to point to the new SQL Server 2017 instance, clicked Test (which was successful), saved, clicked Start Collection and got an error
TF400787: The host 'DefaultCollection' cannot be started. The servicing needs to be scheduled and completed before the host can be started.
The TFS account I'm using to run TFS Admin Console is a sysadmin on all databases: TFS_Configuration, TFS_DefaultCollection and TFS_Warehouse.
How can I resolve this error and attach "DefaultCollection?"
How can I resolve this error and attach "DefaultCollection?"
The cause of this problem seems to be the loss of data in the database.
Generally, there will be backup database when using tfs or before tfs upgrade. You could use the backup of the databases to restore the database.
Here are the steps to re-configure the TFS:
Step1: Unconfigure the TFSfeature. You could use the "Remove feature" option in Administration console to remove feature or use the TfsConfig setup / uninstall:All
Step2: Restore the database from the backup.
Step3: Configure the TFS again in Administration Console.
In addition, you could go to TFS Administration Console -> the target collection -> Status tab. Then you could find the job that is failed, try to click the Rerun Job button and check the result.
Here is the ticket with a similar issue, you can refer to it

Visual studio tfs multiple server add issue

I have TFS server connected to visual studio. And
I have restore it to another tfs server differnet name. Now i need add new server to visual studio. When i try to add it getting server with same id already exists.
You need to change the TFS or Azure DevOps Server's ID or GUID of the new instance. You can do that by using the TFSConfig command line.
TfsConfig changeServerID /sqlInstance:<serverName> /databaseName:<configurationDatabaseName>
[/projectCollectionsOnly] [/configDBOnly] [/collectionName]
Not sure your detail process of restoring operation. However according to your description, guess you may have two same server ID(applicationID)
You could find your old Team Foundation Server GUID Info in below location:
C:\Program Files\Microsoft Team Foundation Server 1x.0\Application Tier\Web Services\web.config
There should be a value like
Then you could compare the GUID of two servers old and new TFS server, change one of them and re-register db. You may need to restart sever, tfs service.
More details about it, please take a look at this blog: How to find Team Foundation Server(TFS) GUID Info
As how to change server ID, just as Niel mentioned, you could use TFSConfig command:
TFSConfig ChangeServerID /SQLInstance:server_db /DatabaseName:TFS_Configuration
Note: After you use the changeServerID command, you must direct clients to create a connection to the changed server before it can be used.

How to test new TFS server without upgrading original

We have a TFS 2013 instance that requires upgrading. I plan to use Azure DevOps 2019 on prem. I'd like to have the two environments running at the same time so I can verify. What I'd like to do is:
Do full install of Azure DevOps server, creating new DBs on a new SQL server. I do NOT want to upgrade our existing TFS at this point.
Copy the data from the original TFS SQL instance to the new SQL instance, performing an upgrade along the way.
Test and verify all data successfully migrated to 2019
Schedule a blackout window and repeat the import process once again
Can anybody advise if this is do-able or refer me to a guide?
Tks
Easier than I thought. Just needed to run the pre-production upgrade wizard.

In place TFS 2012 to TFS 2013 upgrade?

We have created a VM clone of our TFS server (but haven't turned on networking yet for the clone).
We have created a test SQL server that we plan on using for the test upgrade.
I'm not sure what we should do first (after populating the tfs databases on the test SQL server).
Since our test TFS server is a VM clone, TFS is installed and configured already. The Cloned TFS server is pointing to our production SQL server. Are the following steps correct:
Turn on networking for the Cloned TFS server
Remote into the Cloned TFS server
Run command TFSServiceControl quiesce
Run the command TFSConfig PrepareClone
Run the command TFSConfig ChangeServer ID
Run the command TFSConfig RemapDBS
Update the TFS URLS in the admin console
Edit Reporting to point to the new test Reporting instance
Update all service accounts
Are the steps correct? I am not sure which order to carry out the steps out after the TFS databases have been put on the test SQL server. Any help would be greatly appreciated.
I would suggest doing the following:
Unconfigure your test server. I assume you don't want to upgrade your production server yet, you just want to test the upgrade, correct? If that's the case run 'TfsConfig.exe setup /Uninstall:All' to unconfigure the new server.
(if you haven't done it already) Backup all TFS databases from production server. You'll need all DBs with the names starting with 'Tfs_' including Tfs_Configuration, Tfs_Warehouse and all collection databases.
Restore TFS backups from production on VM or some other test SQL server (using SQL server management studio)
Run tfsconfig changeserverid command (on the new server) to change the TFS server id. It's required because you want to have both TFS instances live for some time. If you don't do it, VS clients will think that it's the same server (even though the name is different) and this can cause some issues.
Run tfsconfig remapdbs command (on the new server) which will fix the old Tfs_Configuration database. This is only required because you are moving TFS to a different machine (with a different name)
Now you can start TFS management console and perform the actual upgrade which is pretty straightforward. Upgrade wizard will ask you for the new service account names and new test reporting instance location.

Transfer TFS 2012 to another machine

Now we plan to move our running Tfs server to another machine in data center.
Running tfs server specifications:
1.Having several tiers: two app tiers and two data tiers
Data center tfs server specifications:
1.Single box topology: the data base and the tfs server in the same virtual machine
We have done the following steps to do backup:
Run tfsbackup.exe (C:\Program Files\Microsoft Team Foundation Server 11.0\Tools) to backup the tfs from running tfs
Backup all data bases including the report servers (the data bases are selected default by tfsbackup.exe tool)
Backup the encryption key for reporting services (followed steps in here)
After backup, we do the following to restore the tfs:
Log to data center tfs server as tfs service account (the tfs service account should be in local administrator group)
Run the TfsRestore.exe (C:\Program Files\Microsoft Team Foundation Server 11.0\Tools) to restore data base backup
After restore, open the tfs console to attach the collection from the restored data base
Issue:
When we try to attach the collection, we are blocked at the step to list the available data base: the restored data base can't be listed out.
Could anyone give some suggestion?
Thank you very much.
After some investigation, we found out the way to store the tfs is wrong.
Actually we are doing tfs transfer. So we should do the following steps to do tfs transfer and it works:
Logon tfs server in data center as tfs service account, and the tfs service account should be in local administrator group
Open tfs console and remove tfs feature : remove the current installed tfs instance
Manually delete all tfs related data bases in data base server
Be sure the related tfs service is running including www service
Run the TfsRestore.exe (C:\Program Files\Microsoft Team Foundation Server 11.0\Tools) to restore data base backup
Run TFS installer and follow the Application-Tier Only wizard to do tfs transfer configuration
At the data base step, click list available data base to list the restored data base
Restart the tfs server
Check the tfs configuration in the tfs console and update some links
10.
Thanks.

Resources