Unsupported Screen Size: The viewport size is too small for the theme to render properly.

synchronization with SJA

  • This topic is empty.
Viewing 5 reply threads
  • Author
    Posts
    • #9009
      frank1774
      Member

      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.

    • #17949
      peterlaursen
      Participant

      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!

    • #17950
      frank1774
      Member
      peterlaursen 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?

    • #17951
      Shadow
      Member

      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…

    • #17952
      peterlaursen
      Participant
      Quote:
      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 😉

    • #17953
      Shadow
      Member

      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.

Viewing 5 reply threads
  • You must be logged in to reply to this topic.