Identity Server unable to access DB while upgrading the Orchestrator

How to troubleshoot error "A network-related or instance-specific error occurred while establishing a connection to SQL Server"?

This article provides a detailed troubleshooting guide for resolving the error “A network-related or instance-specific error occurred while establishing a connection to SQL Server” encountered during the upgrade of Orchestrator.

Steps to Resolve:

  1. Enable Named Pipes Protocol:

    • Open SQL Server Configuration Manager.
    • Navigate to SQL Server Network Configuration -> Protocols for [Your Instance Name].
    • Ensure "Named Pipes" is enabled. If it is disabled, right-click and select "Enable".
  2. Check SQL Server Services:

    • Open Services.msc.
    • Ensure that the SQL Server services (SQL Server, SQL Server Browser) are running. Start them if they are stopped.
  3. Verify SQL Server Instance Name:

    • Make sure the SQL Server instance name is correct in the connection string.
    • Check the connection string format: Server=[ServerName\InstanceName];Database=[YourDatabaseName];Integrated Security=True;.
  4. Firewall and Network Configuration:

    • Ensure that the firewall on the SQL Server is not blocking the connection.
    • Open the necessary ports (default is 1433 for SQL Server).
  5. SQL Server Authentication:

    • Ensure that SQL Server is configured to allow remote connections.
    • Open SQL Server Management Studio (SSMS).
    • Right-click on the server instance, select Properties, go to the Connections tab, and check "Allow remote connections to this server".
  6. Check SQL Server Error Logs:

    • Open SQL Server Management Studio.
    • Go to Management -> SQL Server Logs and check for any related error messages.
  7. Reboot the Server:

    • If changes have been made to the SQL Server configuration, a reboot may be necessary for the changes to take effect.