Add a location field C(1) to indicate which location the record was created in (A or B), and then generate primary keys as GUID's. Now, when you update location B with Location A's data, you just delete for location A in location B's data and then insert location's A's records into Location B's tables.
Sergey Berezniker has the GUID code for you already done:
http://www.berezniker.com/content/pages/visual-foxpro/generate-guid
Brandon Harker
Sebae Data Solutions