Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

New installation on IIS won't connect to MSSQL database

  • techturtle
  • techturtle's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 months 1 week ago #258316 by techturtle
Please help us help you and fill where relevant:
Your LimeSurvey version: 6.4.10
Own server or LimeSurvey hosting: Own Server (IIS/MSSQL)
Survey theme/template:
==================
We have a 2.5 version of Lime running on a server we're trying to retire.  I have a Windows 2019 server running with IIS, including PHP 8.3.2 and LimeSurvey 6.4.10 installed.  When I access the LimeSurvey folder through the browser, it prompts me to start the installation.  All the pre-checks pass with minimum or exceeds requirements.  However, once I get to the database page, it never connects correctly.  We would like to just use the old database but are willing to create a new one.  The database login is a MSSQL login account that is still functioning for our old version surveys.  In the installer, it doesn't seem to be even attempting to connect (nothing shown in database logs, even with bad credentials entered).  It never finds the old database, and when I say to create one it always shows as failed and suggests checking credentials.  No attempts to create are logged in the SQL Server.  The database is on a custom port but we have tried all of the following with no noticeable change:

servername
servername:port
servername,port (this is how it looks on the old server config.php)
servername.domain.local
servername.domain.local:port
servername.domain.local,port
IPaddress
IPaddress:port
IPaddress,port

Any help would be appreciated.  Is there something specific that I needed to do in IIS to set this up?  The installer just started running when the LimeSurvey folder was put in the default site location.  I don't think we did any customization to it in IIS, and nothing in PHP beyond enabling all the required add-ons.  I know we don't have any internal firewall blocks between the IIS server and the DB server because we have other apps running on that IIS install that talk to the database just fine.  Is there any way that I can bypass the browser installation and just configure it manually?  

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 months 1 week ago #258324 by holch
Is the PDO database driver installed?

PDO database driver for MySQL (pdo_mysql or pdo_mysqli) or Postgres (pdo_pgsql) or MSSQL (pdo_sqlsrv for Windows and pdo_dblib for Linux).

manual.limesurvey.org/Installation_-_Lim...rvey_on_your_website

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Please Log in to join the conversation.

  • techturtle
  • techturtle's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 months 1 week ago #258393 by techturtle
Yes, the PDO_SQLSRV is installed and detected by the installer.
 

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 months 1 week ago #258460 by DenisChenu
I have this issue with MSSQL : bugs.limesurvey.org/view.php?id=19387

Maybe related ?

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.

Please Log in to join the conversation.

  • techturtle
  • techturtle's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 months 17 hours ago #258854 by techturtle
That does sound like it could be the source of my issue. Is there any workaround for it, since the bug report has not been resolved yet?

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 months 17 hours ago #258855 by holch
Add your comments to the bug. More movement, more likely to get fixed.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: DenisChenu

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 months 52 minutes ago #258870 by DenisChenu
Currently ; i add manually the needed part at github.com/LimeSurvey/LimeSurvey/blob/6d...rConfigForm.php#L584

It's a one time hack.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.

Please Log in to join the conversation.

  • techturtle
  • techturtle's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 weeks 1 day ago #265616 by techturtle
Can you explain what you changed where in the install files? I have tried changing several bits there but nothing seems to enable the connection.

I know the server with LS on it can reach the one with the SQL DB, and I know that several of the users I have tried have the required access, but I have yet to get it past the DB config step in the startup wizard, either for creating a new DB or for connecting to my old one.

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 weeks 6 days ago #265640 by DenisChenu
What i do :
Code:
/**
     * @return string
     */
    private function getMssqlDsn()
    {
        $port = $this->getDbPort();
        $sDatabaseLocation = $this->dblocation;
        if ($port != '') {
            $sDatabaseLocation = $this->dblocation . ',' . $port;
        }
        $sDSN = $this->dbtype . ":Server={$sDatabaseLocation};";
        if ($this->useDbName) {
            $sDSN .= "Database={$this->dbname}";
        }
        $sDSN .= ";TrustServerCertificate=1";
        return $sDSN;
    }

Adding the line : $sDSN .= ";TrustServerCertificate=1";

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose