forums › forums › SQLyog › Sync tools, Migration, Scheduled Backup and Notifications › Odbc -> Mysql, Deleting Old Rows From Destination
- This topic is empty.
-
AuthorPosts
-
-
December 11, 2006 at 11:23 pm #10079terboniumMember
I am importing from an ODBC source and saving into a MYSQL table. I run the job hourly to keep the destination mysql table up-to-date. The source ODBC table often has rows removed, which must be removed from the destintation MYSQL table. Migration updates rows properly if they have changed, however it will not remove rows that have been deleted in the source. Attached is the migration config.
192.168.2.132 xxxxx zzzzzz 3306 [default] estore mmKit select SKURECID, PARTRECID, SKU, QUANTITY from UNNAMED order by RECID mmkit
no SKURECID parentID int 10 yes no yes no no no PARTRECID childID int 10 no no yes no no no SKU child_partnumber char 16 yes no yes no no no QUANTITY quantity decimal 10 no no yes no no no no MYSQL Data Sync smtp-server.neo.rr.com 25 yyyy-mm-dd hh:mm:ss -
December 12, 2006 at 5:07 am #23080peterlaursenParticipantQuote:The source ODBC table often has rows removed, which must be removed from the destintation MYSQL table.
yes! we are aware of this. We also have discussed if we can do something about this. But priorities are so that we will only look into this after the MySQL Users Conference (end of April 2007).
-
December 12, 2006 at 5:16 am #23081terboniumMemberpeterlaursen wrote on Dec 12 2006, 12:07 AM:yes! we are aware of this. We also have discussed if we can do something about this. But priorities are so that we will only look into this after the MySQL Users Conference (end of April 2007).
okay.. well in the mean time is there a fix? is there a way to run a post or pre sql command after the sync is complete? actually, never mind, maybe I'll just do a ODBC->MySQL copy up to the server, then just right my own little script to sync the two tables within mysql. OR.. WAIT, how about this.. could I run one job to copy from the ODBC source to a temporary mysql table, then use the MySQL<->MySQL sync functions to merge the changes between the temp table and the “live” mysql table..
-
December 12, 2006 at 6:18 pm #23082terboniumMemberpeterlaursen wrote on Dec 12 2006, 12:07 AM:yes! we are aware of this. We also have discussed if we can do something about this. But priorities are so that we will only look into this after the MySQL Users Conference (end of April 2007).
IT WORKS!
Created a local mySQL database on the server which hosts the ODBC data source.
The sync process runs from a bat file as follows:
1. Delete all the rows in the local mySQL table
2. Copy the ODBC source table to the local mySQL table
3. Sync the local mySQL table with the mySQL table on the internet
DONE!
It all happens in less that 10 seconds. The local ODBC copy is very fast. The mySQL->mySQL sync is also very fast, and it is able to catch deleted rows from the local source mysql table as well as any changes or additions.
-
-
AuthorPosts
- You must be logged in to reply to this topic.