How to upgrade the SQL Server LocalDB (required for LHC) on the controllers

How to upgrade the SQL Server LocalDB (required for LHC) on the controllers

book

Article ID: CTX341800

calendar_today

Updated On:

Description

How to upgrade the local sql DB on the DDC's


Instructions

Steps to upgrade SQL Server LocalDB are as follows;

What you need:

  • The Citrix Virtual Apps and Desktops installation media (for the version you’ve upgraded to). The media contains a copy of Microsoft SQL Server LocalDB. For example, CVAD 2402 media contains the SQL Server 2022 LocalDB installer.
  • A Windows Sysinternals tool that you download from Microsoft.

Procedure:

  1. Complete the upgrade of your Citrix Virtual Apps and Desktops components, databases, and site. (Those database upgrades affect the site, monitoring, and configuration logging databases. They do not affect the Local Host Cache database that uses SQL Server Express LocalDB.)
  2. On the Delivery Controller, download PsExec from Microsoft. See the Microsoft document PsExec v2.2.
  3. Stop the Citrix High Availability Service.
  4. From the command prompt, run PsExec and switch to the Network Service account.

    psexec -i -u "NT AUTHORITY\NETWORKSERVICE" cmd

    Optionally, you can use whoami to confirm that the command prompt is running as the Network Service account.

    whoami

    nt authority\networkservice

  5. Move to the folder containing SqlLocalDB.

    cd "C:\Program Files\Microsoft SQL Server\120\Tools\Binn"

    **Where '120' is the version of currently installed LocalDB. It could be 120 / 140 / 150 / 160 etc.
  6. Stop and delete CitrixHA (LocalDB).

    SqlLocalDB stop CitrixHA

    SqlLocalDB delete CitrixHA

  7. Remove the related files in C:\Windows\ServiceProfiles\NetworkService. You can use windows file explorer and delete the files.

    Files:
    HADatabaseName.* HADatabaseName_log.* HAImportDatabaseName.* HAImportDatabaseName_log.*

    Tip: Your deployment might not have HAImportDatabaseName.* and HAImportDatabaseName_log.*

  8. Uninstall SQL Server Express LocalDB from the server, using the Windows feature for removing programs.
  9. Install updated version of SQL Server Express LocalDB. In the Support > SQLLocalDB folder on the Citrix Virtual Apps and Desktops installation media, double-click sqllocaldb.msi. A restart might be requested to complete the installation. (The new SQLLocalDB resides in the folder with a new version, example: C:\Program Files\Microsoft SQL Server\160\Tools\Binn.)
  10. Start the Citrix High Availability Service.
  11. Ensure that the Local Host Cache database was created on each Delivery Controller. This confirms that the High Availability Service (secondary broker) can take over, if needed.

    • On the Controller server, browse to C:\Windows\ServiceProfiles\NetworkService.
    • Verify that HaDatabaseName.mdf and HaDatabaseName_log.ldf are created.

Ref : https://docs.citrix.com/en-us/citrix-virtual-apps-desktops/upgrade-migrate/upgrade.html

Environment

Citrix is not responsible for and does not endorse or accept any responsibility for the contents or your use of these third party Web sites. Citrix is providing these links to you only as a convenience, and the inclusion of any link does not imply endorsement by Citrix of the linked Web site. It is your responsibility to take precautions to ensure that whatever Web site you use is free of viruses or other harmful items.

Issue/Introduction

Steps to upgrade the local DB on the DDC's