One Star

Copy table from one server to another

Hi everyone,
Does anyone know what would be the easiest or "normal" way to copy a table from one server to another using Talend? I mean, which components would normally be best suited for this job?
I already have the table created in my target database, so I only need to transfer the data in the source table.
Thanks!
Cihan
11 REPLIES
One Star

Re: Copy table from one server to another


Would, for example, a simple job like this do it?
When I run it, I get a "Exception in component tMSSqlOutput_1 java.sql.SQLException: Network error IOException: Connection refused: connect" error message, but I guess that's beside the point.
Four Stars

Re: Copy table from one server to another

Hi Cihan
- Create metadata for first server
- Create metadata for second server
- use following flow
tDBInput(server1)-->tDBOutput(server2)
Above is sample scenario...
Vaibhav
Moderator

Re: Copy table from one server to another

Hi,
DB input-->DB Output is a "normal" way to copy a table from one server to another.
For your error, Network error IOException: Connection refused: connect" error message.Your DB connection paramater is not correct. please check it.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Copy table from one server to another

OK, regarding my own job: I have corrected the connection, and everything works, but no rows are actually inserted into the target table. It is simply blank.
Regarding Vaibhav's solution: I'll do it in a minute and let you know how it went.
Thanks!
Seventeen Stars

Re: Copy table from one server to another

  Test if the target output component has set the option Die on error.
One Star

Re: Copy table from one server to another

The documentation here https://help.talend.com/search/all?query=tDBInput&content-lang=en says that I need to fill in the database name of the tDBInput component, whereas in my Talend the field is called "datasource".
What exactly is the difference between them? What am I supposed to put in that field?
Moderator

Re: Copy table from one server to another

Hi cihanc83,
What's your DB? Not Mssql server?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Copy table from one server to another

Both the target and the source DBs are on an MS SQL server.
@jlolling: Die on error is not checked and still nothing gets inserted...

Six Stars

Re: Copy table from one server to another

Because you are "Using an existing connection" you have changed Talend's transaction mode from implicit to explicit, meaning you must now specify the commit on that connection using a tMSSQLCommit after your tMSSQLOutput. If you are not sharing existing connections, then each component will create and use its own connection and auto-commit when finished.
Seventeen Stars

Re: Copy table from one server to another

Exactly this is the problem!
@cihanc83 you miss my point. It is recommended to set this option to get the error messages.
You have to add the tMSSqlCommit (triggered by the  tMSSqlInput_1 with OnSubjobOk) and you have to add the tMSSqlRollback + tDie triggered with OnSubjobError also from tMSSqlInput_1.
One Star

Re: Copy table from one server to another

Thanks for the help. I'll try those and update the thread.