0
votes

My company is using a TFS 2013 (Update 4 = 12.0.31101.0) server for development. I was tasked with migrating the TFS server to VSTS but realized I had to update to TFS2018 to be able to use the current migration tool.
My boss obviously didn't like the idea of performing "open heart surgery" on our productive environment so we created a back-up of the SQL Collection-Database (by creating a dump using Management Studio) installed a Trial Version of TFS/SQL Server in a VM (VirtualBox) and tried importing the back-up.

Using the built-in import tool (TFS\Tools\TfsRestore.exe) I imported the old DB into the SQL Server, which actually worked really well, looking at the DB in ManagementStudio everything that needs to be there seems to be there.

However, trying to attach the Team Project Collection in the Team Foundation Server Administration Console I simply can't find it. I List Available Databases and the only one it finds is the DefaultCollection that was created during installation of the server.

I made sure that the versions are the exact same version, only difference is the License which is a real License on our production environment and a Dev License on the VM.

Anyone got an idea why this is happening? Maybe some way to get a more detailed Exception?

Edit: Trying to use the TfsConfig registerDB command throws an expection:
TFS30040: The database is not correctly configured. Contact your Team Foundation Server administrator

3

3 Answers

0
votes

First, please make sure you are a member of the Team Foundation Administrators security group and a member of the sysadmin security group for any SQL Server databases that the new Team Foundation Server uses.

Usually this kind of issue should be solved after giving proper database permissions to the user.

Besides, after the configuration you can try RemapDBs to redirect TFS to its databases.

Back to the error: TF30040: The database is not correctly configured. Contact your Team Foundation Server. Here is a similar thread for your reference: TF30040: The database is not correctly configured

Moreover, you could also check the event view on your VM, if there are some more detail error message for troubleshooting.

0
votes

Did you detach the collection in the TFS admin console before taking the backup on your 2013 server?

When you detach the collection is moves all of the relevant data from the TFS configuration database in to the collection database. You can then take a backup of the collection database and restore it to the new SQL server instance.

Note that detaching the collection will take it offline until the backup is complete and you re-attach the collection.

Then the new version of TFS should be able to see the collection and attach it. This will copy the configuration data to the new configuration database and you'll be able to bring the collection online.

So steps are

  1. Detach collection in TFS 2013
  2. Take backup of the TFS 2013 collection DB
  3. Re-attach the TFS 2013 collection so that users can continue to use the collection whilst you test your upgrade
  4. Copy the backup to the 2018 server
  5. Restore the backup
  6. In the TFS 2018 Admin console attach the collection

Once you're happy that the upgrade will go smoothly repeat the process but skip step 3.

0
votes

Managed to do it by following this guide : https://cromwellhaus.com/2013/08/restoring-tfs-2012-to-sandbox/

Short Version: I was missing the config database, it was quite easy once I was using the old config.