Problem

Migrate module (sqlsrv.inc) uses an incorrect way how to add a port to the server IP address or server hostname.
If someone specifies a custom port for connection to MS SQL server as the 'port' key in database config, the connection fails.

The Correct syntax for the $host parameter in sqlsrv_connect function is IP,port, not IP:port.

For more info, see

Correct example:

sqlsrv_connect('10.0.0.100,1434', $connectionInfo);

Solution:

Replace ':' with ',' where the $host is created.

A patch is attached.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

martin_klima created an issue. See original summary.

martin_klima’s picture

Status: Active » Needs review
FileSize
549 bytes
martin_klima’s picture

Issue summary: View changes
janadam’s picture

Status: Needs review » Reviewed & tested by the community

Thank you for patch, this is very helpful if you need to specify other than default port.

pifagor’s picture

  • pifagor committed 5b3e2ce on 7.x-2.x authored by martin_klima
    Issue #3100013 by martin_klima, janadam: Fix custom port for MS SQL...
pifagor’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

joseph.olstad’s picture

joseph.olstad’s picture