forums › forums › SQLyog › Sync tools, Migration, Scheduled Backup and Notifications › synchronization with SJA
- This topic is empty.
-
AuthorPosts
-
-
May 25, 2005 at 8:38 am #9009frank1774Member
I'm trying to sync 2 db tables with the following xml config:
Code:
127.0.0.1
t3w3LMZDEV 3306 t3w3LMZDEV_V140
127.0.0.1
t3w3LMZDEV 3306 t3w3LMZDEV_LIVE_V130
`fe_groups`
tstamp `fe_users`
`tx_dcnews_news`
tstamp
when i start the sync on the command line always the source overrides the target db table. if i do changes on a record in the target db table, the sync overides the changes with the source records of this table.
have any one an idea why my changes in the target db table are not synced to the source table.
if i made changes in the source table, the sync works fine and rides the chages to the target table.
-
May 25, 2005 at 8:42 am #17949peterlaursenParticipant
That probably is because the PRIMARY KEY is identical for the record in source and target.
When that is the case data from the source will ALLWAYS overwrite the target. That's how SJA works. There is no other way for SJA to decide which data are the “right” ones.
Go throgh the forum and read dozens of post on the matter!
-
May 25, 2005 at 8:55 am #17950frank1774Memberpeterlaursen wrote on May 25 2005, 08:42 AM:That probably is because the PRIMARY KEY is identical for the record in source and target.
When that is the case data from the source will ALLWAYS overwrite the target. That's how SJA works. There is no other way for SJA to decide which data are the “right” ones.
Go throgh the forum and read dozens of post on the matter!
Thanks for the fast answer…
I already looked for similar postings at the forum…
Is the answer for my problem -> do not config the same primary keys for source- and target tables?
-
May 25, 2005 at 9:11 am #17951ShadowMember
Well, synchronization means to bring two tables in separate databases (possibly located on separate hosts) with same structure to exactly the same state. The result is, if you change a record in the source db that has a corresponding record in the target db (same pk), then that record will be changed to resemble the source table…
-
May 25, 2005 at 9:12 am #17952peterlaursenParticipantQuote:Is the answer for my problem -> do not config the same primary keys for source- and target tables?
No that won't work!! Field definitions including the PK must be TOTALLY identical for SJA to work.
You should:
1) select the field(s) that make up the PK with care.
2) select source and target with SJA appropriately
Or to put it in another way: if you have two versions of a DB running at different servers, must must execute some discipline when altering data. That's not a Sqlyog/SJA problem, I believe, but a general database issue
If you got 2 of them, the day comes where you gotta choose 😉
-
May 25, 2005 at 9:17 am #17953ShadowMember
Currently SQLyog does not have a built-in tool for just adding records that are not present in the target database… Of course, you may query the target db to get the list of pks, then query the source db to get entries that are not present in the target db and manually issue the appropriate SQL commands to get them in sync. You can even write a small script to do the job for you.
-
-
AuthorPosts
- You must be logged in to reply to this topic.