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

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • in reply to: Merging Two Mysql Databases #30856
    Chandru
    Member
    'Chandru' wrote on '17:

    Yes. Also, all dependent tables (if any) should be aware of this change to the PK in table. Ex: In DB2:animalTable the PK for Dog and Fish is 1 and 2 . After DB3 creation, it becomes 3 and 4.

    FYI: I forget to mention in my last post that I tried the “Database Synchronization” tool from Powertools Menu and seems it is overwriting the table each time when I synchronise DBs during above scenario. I did not try “Copy database to different host/database” yet.

    Hope this info will helps you. Also, is any contact number where I can directly call up and have a discussion ?

    Thanks,

    Chandru

    One more important point…Please note that all dependent tables of animalTable (references) should be updated accordingly.

    Thanks,

    Chandru

    in reply to: Merging Two Mysql Databases #30855
    Chandru
    Member
    'navyashree.r' wrote on '17:

    Chandru,

    Can you explain what you meant by 'cumulative data'? Is this is the case you are expecting your resultset to be:

    DB3:animalTable


    PK | Name |


    1 | frog |


    2 | ant |


    3 | dog |


    4 | fish |


    Sorry, if wrong please explain what way you are expecting your data to be?

    Thank You in advance.

    Navya

    Yes. Also, all dependent tables (if any) should be aware of this change to the PK in table. Ex: In DB2:animalTable the PK for Dog and Fish is 1 and 2 . After DB3 creation, it becomes 3 and 4.

    FYI: I forget to mention in my last post that I tried the “Database Synchronization” tool from Powertools Menu and seems it is overwriting the table each time when I synchronise DBs during above scenario. I did not try “Copy database to different host/database” yet.

    Hope this info will helps you. Also, is any contact number where I can directly call up and have a discussion ?

    Thanks,

    Chandru

    in reply to: Merging Two Mysql Databases #30853
    Chandru
    Member
    Quote:

    To do this first create “DB3” database where you need to copy tables and their datas from DB1 and DB2 into DB3.

    A. Using “Database Synchronization” tool from Powertools Menu. (right now we are supporting for single database only at a time):

    To perform this first select Source db “DB1” and Target db “DB3” and similarly “DB2” to “DB3” by checking option 'One way synchronization'.

    You can select 'Generate script' option from the wizard as shown in image “data sync.JPG” and edit the script in any editor by selecting only UPDATE statements. You may run Data Sync between master asand slave as , any difference between master and slave will result in INSERTs/UPDATEs/DELETEs on slave.

    FYI,

    Read the FAQ links given below,

    http://www.webyog.co…agent_-sja.html

    Also, to understand data sync in depth please read this article:

    http://webyog.com/en…L_Databases.pdf

    (but note this article is not up-to-date, but principles are the same).

    Additionally, a very important point to notice is that the Primary Key on every table must be defined in such a way that the same value for the PK will never be created for different data on different hosts.

    B. Another option is to use “Copy database to different host/database”. First select source DB1 and target DB3 and copy the data. Similarly follow same to copy from DB2 to DB3.

    You can go through our Help document too.

    Regards,

    Navya

    Navya,

    Thanks for detailed information.

    In fact I will having the exact scenario as you mentioned above. i.e Same Primary Key(PK) in DB1 and DB2 tables will have the different data.

    The below example will give you a clear picture and let me know is any way we can achieve this using SQLyog tool.

    Example:


    If you observe in below table, the same PK's will have different data in tables DB1:animalTable and DB2:animalTable. So, my expectation from the tool would be the DB3 (DB1 + DB2) will have cumulative data from DB1 and DB2.

    DB1:animalTable


    PK | Name |


    1 | frog |


    2 | ant |


    DB2:animalTable


    PK | Name |


    1 | dog |


    2 | fish |


Viewing 3 posts - 1 through 3 (of 3 total)