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:
MigrateSourceMSSQL class does not support "CharacterSet" key in the configuration array. The migration is not able to import data containing any multibyte characters.
Function sqlsrv_fetch_object() returns false for such rows with multibyte characters.
The migration does not process all rows from SQL queries and gives no explanation of why some rows are unprocessed.
Solution:
- Extend $connectionInfo array with "CharacterSet" key.
- Add 'character_set' => "UTF-8" to the database configuration array.
A patch is attached.
Comment | File | Size | Author |
---|---|---|---|
#7 | interdiff_2-7.txt | 976 bytes | martin_klima |
#7 | migrate-mssql_multibyte_support_3097408-7.patch | 1.29 KB | martin_klima |
|
Comments
Comment #2
martin_klimaComment #3
martin_klimaComment #4
martin_klimaComment #5
martin_klimaComment #6
klausiyou say in the docs that this new parameter is optional, but you don't check it with isset() here?
This will cause PHP warnings when people upgrade the module, we should check the character_set key before adding it to the $connectionInfo.
And can you split this over multiple lines? Very hard to read in this long line.
Comment #7
martin_klimaThank you for your review @klausi. I fixed the issue.
Comment #8
klausiLooks good, thanks!
Comment #9
pifagorComment #11
pifagorComment #13
joseph.olstadhttps://www.drupal.org/project/migrate/releases/7.x-2.12