Create a Bluemix application
First, create a PHP application using IBM Bluemix.
A database service such as ClearDB must be connected to the application.
In order execute the web application properly,Â do not forget to create a file called â€śoptions.jsonâ€ť, and include it in a folder named â€ś.bp-configâ€ť.
The options.json file must include the following code:
"PHP_EXTENSIONS" : ["mysqli"]}
Create a Talend Data Integration project
Create a new Talend Data Integration Project:
Click on â€ścreate new projectâ€ť, and then, â€śCreateâ€ť
Then, Tick â€śSelect an existing projectâ€ť to select the previously created project and after that, click â€śFinishâ€ť.
Create a connection for each database
After the project is loaded, go to the Repository Panel and expand the Metadata menu. Then, right click on â€śDB Connectionsâ€ť and select â€śCreate Connectionâ€ť.
It is important to create an on-premise database to store the data that would be uploaded to the on-demand database when performing an update.
For this example, the on-premise database was called â€śProviderâ€ť, and the on-demand database was named â€śDatawarehouseâ€ť.
Write the on-premise database name and then click â€śNextâ€ť:
Then, insert the database Type and the database credentials
For this example, the database management system that was used to create the â€śProviderâ€ť database was MySQL. So, that will be the DB Type.
Then, click â€śCheckâ€ť to confirm if the connection was successful.
If so, click OK, and then, Finish.
After creating a connection for the created for the on-premise database called â€śProviderâ€ť, We should proceed to create another for the on-demand database (Datawarehouse) in a very similar way to the first connection:
Then, write the database credentials and click â€śFinishâ€ť.
Extract Schemas from the two databases
First, right click the â€śDatawarehouseâ€ť database connection and select â€śExtract Schemaâ€ť.
A window will appear.
Then, select the database and the tables you wish to transfer. In this case, all tables will be selected.
After that, click â€śFinishâ€ť.
Finally, extract the schema from the â€śProviderâ€ť database (right click on the database name displayed in the repository panel on the left, select â€śExtract Schemaâ€ť, select the tables you wish to work with, click Next, and finally, click Finish)
Go to the Repository Panel on the left, and select â€śJob Designâ€ť. Right click on it, then, select â€śCreate Standard Jobâ€ť.
The following window will show up:
Write the job name. In this case, it was called â€śetlFromProviderâ€ť. Then, click Finish.
Go to Provider (Database) in the Repository Panel. Expand â€śTable Schemasâ€ť and select the table you are going to work with.
Drag the table to the main area, and the Components window will pop up. Select tMySqlInput from the Components Window, and click OK.
It will look this way:
After that, expand â€śDatawarehouseâ€ť (name of the on-demand database) from the repository menu, and find â€śTable Schemasâ€ť. Expand it and drag a table to the main area.
Select tMysqlOutput, and click OK.
The diagram will look like the following one:
Go to the palette, expand it, and select tMap.
Drag tMap to the main area.
Right click the Providers table icon in the main area. Select Row, and then, Main. Drag the arrow to the tMap component.
Right click tMap, select Row, and then, select New Output. Drag the arrow to the Datawarehouse table.
Give any name to the output.
This would be the result:
Double click the tMap component
Then, click on Automap, on the upper left corner.
All table rows should be related. Click on APPLY and then, OK.
Finally, execute the process by clicking RUN:
If the process ran successfully, the following message would appear:
And the synchronized tables will be updated