How to change the connector of a data source?
ConfigHub does not allow to edit the connector (the 'connect via') of an existing data source. The reason is that 2 connectors can run on different servers and if deletion of a data source in connector A or adding a data source in connector B fails, we could end up with a data source being deleted completely or being added twice. To avoid this potential risk, if a data source needs to be moved from connector A to connector B this needs to be manually executed via the connector API.
Prerequisites
The APIs of both connectors are reachable (can be called successfully).
The user performing the move knows the password of the user account configured on the data source which needs to be moved.
You'll need a TrendMiner user account with the admin role to run a global monitor health check.
The following steps can be executed on the respective connector API interfaces to move a data source from connector A to connector B:
Get the details of the data source you want to move away from connector A. This article shows the API call which can be used to get the details.
Copy the details of the data source to a text file. Example of the expected output:
{ "DbId": 21, "Name": "PI2018", "Prefix": "CS", "TagFilter": "", "Provider": "PIOLEDB", "DataSource": "cs-pi2018.trendminer.net", "UserId": "pi2018user", "Password": "********", "Version": "other", "OnlySupportsRawValues": false, "Properties": [ { "key": "TAGFILTER", "value": "" } ] },
Delete the data source from connector A doing a
DELETE /database/{id}
call.Edit the following in the data source details of the text file:
Remove the field “DbId” and its value
Replace the password value ************* with the actual password (between quotes)
Remove the ‘,’ at the end
The resulting data should like like this:
{ "Name": "PI2018", "Prefix": "CS", "TagFilter": "", "Provider": "PIOLEDB", "DataSource": "cs-pi2018.trendminer.net", "UserId": "pi2018user", "Password": "mypassword", "Version": "other", "OnlySupportRawValues": false, "Properties": [ { "key": "TAGFILTER", "value": """ } ] }
Important
Never change the “Prefix” or the “Name” when moving a data source. This will result in broken views and formulas.
Add the data source to connector B doing a
POST /database
passing on the edited data source details as the body of the POST call.Conditional step: this step only needs to be executed in case you are changing the connector for an ODBC/OleDB or SQLite data source.
Copy over all ODBC/OleDB/SQLite configuration files from connector A to connector B. When copying please make sure the same folder structure is maintained.
Sync connector A
Sync connector B
Note
Running a monitor health check is recommended as moving data sources might have temporarily made them unavailable, resulting in system-disabled monitors.