Finish connections and passwords
The importer creates one Hop connection for every Talend repository connection, under the same
name, and one for every other database the components use, in metadata/rdbms/. Components that
use the same database, with the same user and password, share one connection.
A connection's settings are variables, not values. A setting the Talend job took from a context
variable keeps it: context.dbHost becomes ${dbHost}. A setting the job had as a literal becomes
a variable named after the connection: ${<connection>_HOST}, _PORT, _DATABASE, _USER,
_SCHEMA and _PASSWORD. The import writes the value the Talend job had into every environment
file under environments/, so the connections work as soon as you run with one of those
environments, and you change a host or a user per environment without touching the project.
What the import cannot carry is a password Talend encrypted: Talend encrypts passwords in an export with a key that is not in it.
1. See what needs a value
In the migration report:
- Environments lists the variables the connections read, and the environment files that hold them.
- Passwords lists every connection and context variable whose password Talend encrypted. Its variable is empty in every environment.
- Connections lists the repository connections, their database type, and
encrypted by Talendwhere you have to add the password.
Open a connection in Hop GUI (Metadata → Relational Database Connection) to see the variables
it reads. For a connection named QBC: host ${QBC_HOST}, user ${QBC_USER}, password
${QBC_PASSWORD}.
2. Set the values per environment
Keep the values out of the project. Don't type a password into the connection either: the
connection file would then hold it, and Hop's Encrypted prefix in that file is obfuscation, not
encryption. For each environment you run with:
-
Create a config file outside the project folder, for example
qbc-test.json:{
"variables" : [
{ "name" : "QBC_HOST", "value" : "sqlserver-test.example.com" },
{ "name" : "QBC_PASSWORD", "value" : "…" }
]
} -
Add it to the environment after the file the import wrote, so that its values win: in Hop GUI under the environment's configuration files, or with
hop-conf -em -e <environment> -ep <project> -eg <imported file>,<your file>.
Set only what differs: a variable your file does not mention keeps the imported value. A password can also come from the environment of the process that runs Hop.
3. Check the database type and driver
The connection's database type follows the Talend component. Two to know:
- SQL Server connections are MS SQL Server (Native), with Microsoft's JDBC driver, which Hop ships and Talend's SQL Server components use by default. Encryption is off, as Talend connects; turn it on in the connection's options if your server requires it. A Talend connection that used the jTDS driver with connection properties of its own gets a review note: Microsoft's driver names them differently.
- Generic JDBC (
tJDBC*) connections are a Hop generic connection with the component's JDBC URL and driver class. Put the driver jar in<hop>/lib/jdbcon every machine that runs the pipelines.
4. Test
Select the environment you are going to run with, then use Test in the connection dialog. The test reads the variables from that environment: without one, they are unset.
Related
- Import into a Hop project: create the environments the import wrote.
- Fix what the import could not convert: the other things a converted job needs before it runs.
- From import to verified project: a tutorial in which a connection is pointed at a real server this way.
- Migrations to Apache Hop, and from Talend in particular: why and how to move, and how we help.