Upgrading Search in TFS 2018 Update 3


In TFS 2018 Update 2 and 3, Elasticsearch support was updated to ES 5.4.1. If you are upgrading from any earlier version of TFS, a Search re-indexing will be required. TFS 2018 Update 3 also introduced basic auth support for connecting to Elasticsearch. To sum up the matrix –

Pre-TFS 2018 Update 2  -> TFS 2018 Update 2 : Re-indexing required
Pre-TFS 2018 Update 2  -> TFS 2018 Update 3 : Re-indexing required + Basic auth support for ES
TFS 2018 Update 2  -> TFS 2018 Update 3 : Basic auth support for ES

Performing an upgrade should be straight forward. I’ll however cover a bit of internals here and some guidance to steps in case the upgrade does not go as expected. The flow I’ve explained below is one of a remote Elasticsearch scenario (i.e. ES and TFS are installed in separated machines).

General Upgrade flow –

  • Unconfigure Search and Application Tier
  • Install new version of TFS
  • Configure Application Tier (on all AT machines in case it’s a multi-AT setup)
  • Configure Search on the primary AT machine (refer this blog post on configuring Search in multi-AT scenario)

While configuring, you need to opt-in to install and configure search.

 

The existing Search Service URL (i.e. Elasticsearch URL) will be pre-populated. Follow the instruction as mentioned to copy the package to the Elasticsearch machine and run the Configure-TFSSearch.ps1 script

.\Configure-TFSSearch.ps1 -Operation update -User {username} -Password {password}

The script will stop the existing ES service, rename the index data folder to something like {IndexDataFolder}.{Timestamp}.old, install the ES 5.4.1 version and start the service.

Input the same username/password in the configuration wizard and proceed with the configuration on the primary AT box.

When the configuration is complete, re-indexing would have been triggered for the entities. You can verify the same quickly in the configuration logs (C:\ProgramData\Microsoft\Team Foundation\Server Configuration\Logs)

[Info   @12:55:16.098] +-+-+-+-+-| Running CodeReindexingJob: Triggering Code Search indexing on existing collections ... |+-+-+-+-+-
[Info   @12:55:16.099]
[Info   @12:55:16.099] +-+-+-+-+-| Triggering Code Search indexing on existing collections ... |+-+-+-+-+-
[Info   @12:55:16.099] Starting Node: CTRIGGERCODESEARCHINDEXINGONEXISTINGCOLLECTION
[Info   @12:55:16.099] NodePath : Container/Conditional/BestEffort/CTRIGGERCODESEARCHINDEXINGONEXISTINGCOLLECTION
[Info   @12:55:16.983] Node returned: Success

(Similar logs will show up Work Item and WIKI entities)

Note, no manual uninstall and re-install of extensions was required as part of the upgrade process. Complete re-indexing duration will depend on the volume of entity data. You can check this blog post on how to monitor the indexing progress.

In the scenario where search is not working post upgrade, you can try uninstalling and re-installing the search entity extension. Go through the detailed reset instructions mentioned in the “Re-index at Collection level: Extension Uninstall and Install” section in the this blog post.

Comments (3)

  1. MagnusTim says:

    Hi Tapas, thanks for a nice blog with good articles.
    We recently upgraded to TFS 2018.3 from TFS 2018.2 at one of our customers. After the upgrade everything in Search looked OK but for some of the TFS projects Work Item Search fails with “No work items found for ‘MySeach’ with applied filters”. Do you have any guidance how we can solve this?

    Regards Magnus

    1. If I understand correctly, Search is overall working for Code and Work Item. It’s for specific terms (with some filters) the work item search is not returning results. We might want to debug the issue further from the indexing history. I would suggest posting a query to VSTS Search Feedback providing the diagnostic info as mentioned here: https://github.com/Microsoft/Code-Search/blob/master/SearchDiagonistics/README.txt, and the team will revert back after initial investigation.

      1. MagnusTim says:

        Hi Tapas, Thanks for your answer. I contacted support and they suggested a reindex at collectionlevel described in one of your blogs.

Skip to main content