When migrating a SQL Server database to AWS or implementing a data migration/transfer strategy to AWS, one common tool used is the Data Migration Service (DMS). This native AWS tool supports various database technologies, including Microsoft SQL Server. However, during the connection process to SQL Server, you may encounter a common error message stating “The Distributor has not been installed correctly.” This error can occur not only with DMS but also with other tools like Qlik.
The error message typically appears in the following format:
Stream component 'XXXXXXXX' terminated Cannot initialize subtask Failed while preparing stream component 'XXXXXXXXXX'. RetCode: SQL_ERROR SqlState: 42000 NativeError: 20028 Message: [Microsoft][SQL Server Native Client 11.0][SQL Server]The Distributor has not been installed correctly. Could not enable database for publishing. Line: 1 Column: -1 Failed (retcode -1) to execute statement: 'exec sp_replicationdboption @dbname = N'XXXXXXXXX', @optname = N'publish', @value = N'true''
This error can also be seen in a different scenario:
Last Error Fatal error has occurred Task error notification received from subtask 0, thread 0 [reptask/replicationtask.c:2858] [1022505] Failed (retcode -1) to execute statement; RetCode: SQL_ERROR SqlState: 42000 NativeError: 20028 Message: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]The Distributor has not been installed correctly. Could not enable database for publishing. Line: 1 Column: -1; Failed while preparing stream component 'st_0_HLNYCZNDQHRBG57NDT2VEQTTIGCORSR66SZNZEI'. Cannot initialize subtask; Stream component 'st_0_HLNYCZNDQHRBG57NDT2VEQTTIGCORSR66SZNZEI' terminated [reptask/replicationtask.c:2866] [1022505] Stop Reason FATAL_ERROR Error Level FATAL
The root cause of this error is that by default, DMS and Qlik check for SQL Server replication, even if replication is not enabled in the SQL Server instance.
The solution to this issue is simple. You just need to add the following parameter to the connection string:
ignoreMsReplicationEnablement=true
Once you include this parameter in the connection string, the connection will succeed without any error being returned or logged.
It is worth noting that there is no comprehensive documentation available for this parameter. However, you may find a reference to it in the Qlik documentation. Unfortunately, there is no clear explanation for this parameter in the AWS documentation for DMS or elsewhere.
By following this solution, you can overcome the “The Distributor has not been installed correctly” error and successfully migrate your SQL Server database to AWS using the Data Migration Service or other similar tools.