-> I was performing an In-Place upgrade of SQL Server from SQL Server 2017 to SQL Server 2019.
-> The upgrade failed with below error,
TITLE: Microsoft SQL Server 2019 Setup
------------------------------
The following error has occurred:
The User Data directory in the registry is not valid. Verify DefaultData key under the instance hive points to a valid directory.
For help, click: https://go.microsoft.com/fwlink?LinkID=20476&ProdName=Microsoft%20SQL%20Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=15.0.4013.40&EvtType=0xD8FB5EBA%25400x97A656BB%25401306%254067
------------------------------
BUTTONS:
OK
------------------------------
-> The error states that there is some issue with the data directory.
-> I right clicked on the SQL Server instance and clicked on properties. Clicked on “Database Settings” and verified “Database default locations”. The data location mentioned is “F:\data1\”. This location is not available on the database server.

-> I corrected it to F:\data which is available on the database server and then clicked OK. Started the In-Place upgrade again and it completed fine.
-> This issue also happens during Service pack and cumulative updates install also. We should make sure that the “Data” and “Log” location is correct under “Database Settings” in SQL Server Instance properties.
Thank You,
Vivek Janakiraman
Disclaimer:
The views expressed on this blog are mine alone and do not reflect the views of my company or anyone else. All postings on this blog are provided “AS IS” with no warranties, and confers no rights.
One thought on “The User Data directory in the registry is not valid. Verify DefaultData key under the instance hive points to a valid directory.”