Your problem is one of replication. The approach that I would take is to provide an additional field in the offline tables for the storage of a "temporary key". That way you can write a program that will update the online data from the offline data and update the keys when you post the offlne data. The temporary key field in the offline data is only used for new records and for those new records the actual key field is left emtpy. When the offline data is posted to the online data the program recognizes the use of the tmp key and makes the replacement with the actual key issued by the online database.