Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
- https://www.php.net/manual/en/function.sqlsrv-connect.php,
- https://social.msdn.microsoft.com/Forums/sqlserver/en-US/f4d6d191-332b-4...
Correct example:
sqlsrv_connect('10.0.0.100,1434', $connectionInfo);
Solution:
Replace ':' with ',' where the $host is created.
A patch is attached.
Comment | File | Size | Author |
---|---|---|---|
#2 | migrate-fix_custom_port-3100013-2.patch | 549 bytes | martin_klima |
|
Comments
Comment #2
martin_klimaComment #3
martin_klimaComment #4
janadamThank you for patch, this is very helpful if you need to specify other than default port.
Comment #5
pifagorComment #7
pifagorComment #9
joseph.olstadhttps://www.drupal.org/project/migrate/releases/7.x-2.12
Comment #10
joseph.olstadhttps://www.drupal.org/project/migrate/releases/7.x-2.12