Jump to content
Welcome to our new Citrix community!
  • Upgrading or Replacing the SQL Local DB for Local Host Cache for 1912 CU1


    cugcblogs

    raydavisrnd.png.5db1f436ba8c9fd35133ca96b89fb993.png by Ray Davis

    There has been some recent change to the LTSR article around Local Host Cache upgrades:

    https://docs.citrix.com/en-us/citrix-virtual-apps-desktops/upgrade-migrate/upgrade.html#replace-sql-server-express-localdb

    • When upgrading Delivery Controllers to Citrix Virtual Apps and Desktops version 1912 or 2003: Upgrading SQL Server Express LocalDB is optional. Local Host Cache works properly, with no loss of functionality, regardless of whether you upgrade SQL Server Express LocalDB. We added the option to move to a newer version of SQL Server Express LocalDB in case there are concerns about the end of support from Microsoft for SQL Server Express LocalDB 2014.
    • When upgrading Delivery Controllers to Citrix Virtual Apps and Desktops versions newer than 2003: The minimum supported version is SQL Server Express 2017 LocalDB Cumulative Update (CU) 16. If you originally installed a Delivery Controller earlier than version 1912, and have not replaced SQL Server Express LocalDB with a newer version since then, you must replace that database software now. Otherwise, Local Host Cache will not work.

    As you can see here, at one time it stated that you needed to upgrade, or it would not work. However, it doesn’t seem that it 100% the case anymore. I think that’s why Citrix updated the doc. 

    Also as you can see here, some had the same concerns or questions around it. I most certainly did. 

    -zjILU68K0NkCgQtlKx2PdgFcJj6SU-Bvd-X4OSs
    1. So, let’s get started. I always do a snapshot first, which is completed. 
    2. 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.)
    3. As you can see, I am on 1912 CU1 and have MSQL Express 2014.
    f_xsDiP-Ld6n087llEy_33Yisd2FhRV0LT8_MXaj
    1. On the Delivery Controller, download PsExec from Microsoft. See the Microsoft document PsExec v2.2.
    b47FR-Z0TQGDPSU2oagl9DkCGgyK13LCp5ETcolu
    1. Stop the Citrix High Availability Service
    Wlw5Q31NjwtR8zWz_u1gURRV68pD5Q4IC3YqblfnJ4o1XIY2W-rMFKQRwpxXJeQgFKVVA24jwjOf2KWmKCbbA9K7uzbvIn4qyx5EKWM25CzGJkKT3dQt71myVQQDR0aETvwxM-o
    1. Open CMD as Admin and open PsExec.exe
    psexec -i -u “NT AUTHORITY\NETWORK SERVICE” cm
    t6RhGyo2BkWEpsJbEo3KiHlNIWtkZvt_nmWxgOMqZlJd7dJE9FwgPdpFbfK_mbaoa5gsm3p6hdsNzsi3
    1. Move to the folder containing SqlLocalDB.
    cd “C:\Program Files\Microsoft SQL Server\120\Tools\Binn”
    WUxQGAlITSLnJzl_lRd1_8fU32eQdoGVqGzrHmZD
    1. Stop and delete CitrixHA (LocalDB).  If you don’t stop it, you will get this error (me not paying attention):
    pY9TVM_wNvg7RgMI4LfywB-HiDvBOyFT_9xPo-O1
    SqlLocalDB stop CitrixHA

     

    SqlLocalDB delete CitrixHA

    8o4wvb4hj8U_mv0vUb0wP8nC2LM2fR2EO9aQteXn
    1. Remove the related files in C:\Windows\ServiceProfiles\NetworkService
    HYtZB6xAQGtQB0iRV2wTKs4Xf7Svjjc5DrrEleKF
    1. Uninstall SQL Server Express LocalDB 2014 from the server, using the Windows feature for removing programs:
    tSrT5O0E7EMlEyz5VU5PiSBahSfr2tIvEw10eu7v

     

    1. Install SQL Server Express LocalDB 2017. In the Support > SQLLocalDB folder on the Citrix Virtual Apps and Desktops installation media, double-click sqllocaldb.msi
    GqySM0FTiY8OPp8tavQByOrDw3ZuimX6QrirfIz2xuZyd9n1lvDmoW5YNqSKV2jnwlGvcFfL0pXeSwterTQQPFdg9UJXdaObnfxZf6prJSqD1K8OvzC2vacQtWO4OEkWOOm6ozbS8JITOaz2iO-RMIHQ2mNxrcuZWCfDD7wVtoNy8FJ6StMHAqiIymoeoF05dN_vGFzcFbbtYOWX5eK9xt6jnqy_l-wrD8jIe9hyLyuO6w1E
    1. Reboot the server and make sure this is started “Citrix High Availability Service.”
    U2HWvsb9Qgj_F-Oa4Xw-xMHz8anNUIrp24jRO2UT
    1. Logged on, and it took about 15 seconds to show up.
    CmQfsed6LErDagpkemQ9um38WEmugw0KXYwtqH8R
    1. Then 60 seconds or so on this
    Zbxs8S7IG8Ga8l5Sjv2DG6AhKYq0a38C3iH346Od
    1. Check if the CitrixHA Db is created. CitrixHA is re-created the next time configuration sync occurs. After a minute or two, use the SqlLocalDB utility to confirm that CitrixHA has been re-created.
    SqlLocalDB i

     

    CitrixHA

     

    MSSQLLocalDB

     

    Example:

    While still in the PsExec session run this:

    C:\Program Files\Microsoft SQL Server\120\Tools\Binn>
    SqlLocalDB i

     

    CitrixHA

     

    MSSQLLocalDB

    2W8Gj6iNgPLSv5mKD-_rIcl-fID95kto27wgh74FeL1ZTmQfS72g9lH-XHnGLjxB1Ej1CDRA04qeccguRRpNDwvD5p1nYkKR302g0_lbYz0xwGlUvQ13JiaH
    1. You will see this until you do the second broker:
    Z13UX_v_cLMuIOnFE8QkFtbV0wZcc2TAXaRmdFxM
    1. After I did my second Broker this was in the logs
    J8WWPdWjwBAF68dvYNIvpROBHkwyEzn2hpDhZdPYHWCZfv15FJwgmSNBFFAL0VfquNg3RHAR-xgQ31Xg
    1. But then, I see this almost every 2 minutes. I remember reading about this. But I thought it was fixed many versions ago. 
    SC21kl-H3Rr4xlV58wB6jk39aMjOVJJ8I7OFm3db

    Did some google on the Errors and came up with the 2 links below:

    https://support.citrix.com/article/CTX230775

     

    LHC DB upgrade reference:

    https://docs.citrix.com/en-us/citrix-virtual-apps-desktops/upgrade-migrate/upgrade.html#replace-sql-server-express-localdb

    Turns out some AD account was deleted over time, and it had some bad SIDs. So, I ran the quick script, to get the output.

    Get-BrokerApplication |foreach {if ($_.AssociatedUserNames -match “S-1-5-21”) {$_.Name; $_.AssociatedUserNames -match “S-1-5-21”; “”}}
    7sMn8eqkocXetk9NXxicPKWvrcZbZEXRzcGRtuvh

    I went into Studio and deleted them from the location it displayed above. Which was in Published application visibility. Then, based on CTX230775, I needed to redo the LHC DB. So I quickly ran through the process and it fixed the error. 

    In summary, this is how I upgraded the LHC DB and some minor troubleshooting. Hope it helps someone.

     

    Thanks again for all the help and tips I've received from everyone on Slack. 

    Also check out Citrix Heroes, a dedicated site for people like us: https://community.citrixhero.com/


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...