Copy data from multiple tables in one database to another

One Star

Copy data from multiple tables in one database to another

I need to copy data from multiple tables in DB1 to the corresponding tables in DB2 (while keeping the existing data in DB2 intact).
While doing this I need to keep the foreign key relationships in DB1 without overwriting data in DB2.
Tables in DB2 may have existing primary key values same as DB1, so while writing data into DB2 new primary key values need to be generated and used wherever they are referenced as foreign keys.
Can this be done using Talent enterprise data integration? If so, how do I go about it?
Both DB1 and DB2 are MySQL databases and have the same schema.
Moderator

Re: Copy data from multiple tables in one database to another

Hi,
It seems you are looking for "Migration DB"? If so, could you please take a look at a related Forum 18793: topic complete migration from oracle to sql server? Let me know if it is OK with you.
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 data from multiple tables in one database to another

Hi Sabrina,
It is not plain migration as I have data in my target database which might have the same primary key values as the source DB which I do not want to overwrite. I want to generate new primary key values while writing into the target DB and also maintain the foreign key references from the source DB for these newly generated primary keys.
Four Stars

Re: Copy data from multiple tables in one database to another

Hi pbhat,
Using system variable Sequence Generator you can generate a primary key...
You will have to write talend jobs for each table with tMap component for generation of key and other transformation if you have any
You can either design multiple subjobs to perform table migration or use single job for all the tables with onSubJobOk link...
There is no need to go for Enterprise edition as it is a plan database migration activity...
Can you pl elaborate simple example with couple of rows from source and what you expect in target... this will help to better understand your scenario..
Thanks
Vaibhav
Two Stars

Re: Copy data from multiple tables in one database to another

Hi all,
I want to copy file from one location to another location but if a file with same name exists in target location ,how can I append data to target location file ?
Thanks and Regards