none
Datachanges getting zero RRS feed

  • Question

  • I had to sync a large database to multiple clients. So inorder to save time i had synchronized my source database to one client and made a copy of that then i attached this copy to all other client servers..Synchronization working but changes are not monitoring..Always getting Total data changes is zero. Am i missing anything..?
    Monday, October 29, 2012 12:15 PM

Answers

  • you just can't copy databases and distribute them to initialize other clients. each replica/copy in sync has an id to uniquely identify it in the sync community.

    if you copy it and restore, you will have clients having the same id which will result to changes not detected/applied.

    if it's a SQL Backup, make sure you run PerformPostRestoreFixup after you restore and before you sync the newly restored database.

    • Marked as answer by sharon 5656 Monday, October 29, 2012 12:59 PM
    Monday, October 29, 2012 12:31 PM
    Moderator

All replies

  • you just can't copy databases and distribute them to initialize other clients. each replica/copy in sync has an id to uniquely identify it in the sync community.

    if you copy it and restore, you will have clients having the same id which will result to changes not detected/applied.

    if it's a SQL Backup, make sure you run PerformPostRestoreFixup after you restore and before you sync the newly restored database.

    • Marked as answer by sharon 5656 Monday, October 29, 2012 12:59 PM
    Monday, October 29, 2012 12:31 PM
    Moderator
  • Thanks.that helped.
    Monday, October 29, 2012 1:09 PM
  • I had synced my server Db with client A then i took a back up file of server DB and restored it in the client B.Then if i try to sync Client A and Client B it will work or not..? 
    Tuesday, October 30, 2012 5:12 AM
  • it should work for as long as you always do PerformPostRestoreFixup after restore and before synching the restored database for the first time.

    btw, am assuming youre using the newer SqlSyncProvider/SyncOrhestrator as these are the ones that supports peer-to-peer synchronization.


    Tuesday, October 30, 2012 6:46 AM
    Moderator
  • newer SqlSyncProvider/SyncOrhestrator means? I think am used same SqlSyncProvider and SyncOrhestrator.Now am not getting any datachanges btw Server Db and Client A.Any help please..
    Tuesday, October 30, 2012 8:33 AM
  • i mean if your using SqlSyncProvider it should work.

    is client A a restored copy of Server Db? did you run the post restore fixup when you restored and before the first sync for clientA?

    if you did, have you checked for conflicts?

    Tuesday, October 30, 2012 8:41 AM
    Moderator
  • Didnt run post restore fix up.Ok i will try that. One more quetion June T,  instead of backup file and restoring if i took a copy of data and log file of Server DB and attached it to Client B, then sync work between Client A  and Client B.? then any need for post restore fix up? 
    • Edited by sharon 5656 Tuesday, October 30, 2012 9:03 AM
    Tuesday, October 30, 2012 8:58 AM
  • as I have mentioned, you cannot copy (either via backup and restore or attaching dbs) without running performpostrestorefixup.

    the performpostrestorefixup does some manipulation on the sync metadata to make sure it will still be able to sync. without it, you will have replicas with identical sync metadata (similar replica IDs etc...)

    Tuesday, October 30, 2012 11:15 AM
    Moderator
  • Thanks for your reply. Getting timeout error during performpostrestorefixup.

    is there any chance If i create a new scope for same set of tables and provision after restoring and do the same thing on other end of the server.?

    All im trying to do is i need to sync my large database to one client.Because of networking and other issues i cant connect it directly to my client.so i had synced my server DB to a machine say Machine A. During this i got lots of timeouts and system out of memory exceptions.But somehow synced it.But didnt get lucky next time.when i tried to Machine A to Client DB, Getting lots of time outs and memory out exceptions and sync failing.Thats why im trying to restore bak file in Client from Server DB.  So any help really appreciate..

    Tuesday, October 30, 2012 12:08 PM
  • the SqlSyncStoreRestore  where you call PerformPostRestoreFixup has CommandTimeout property that you can set.

    CommandTimeout is also available for both provisioning and synchronization.

    if you provision a new scope, you will run into conflicts as both databases contain data already. the new scopes you create has no idea that its data is the same on the other database. so when you sync, it will resend the same data that is already on the destination. it will be much slower than your original sync since it will now fire conflicts for every row.

    Tuesday, October 30, 2012 12:13 PM
    Moderator
  • I fixed the network issues and connected source and client db directly. And before first sync i did PerformPostRestoreFixup  to client db also.It woked first time.Both serverDB and Client DB became synced cleanly.But from second time server changes are not monitoring to client side.This database was neither restored nor copied.so am i need to call PerformPostRestoreFixup to serverDB..?
    • Edited by sharon 5656 Friday, November 2, 2012 9:53 AM
    Friday, November 2, 2012 9:52 AM
  • you only need to call PerformPostRestoreFixup one time after you restore.

    when update the record on the server, do you see the corresponding record in the _tracking table updated?

    have you tried subscribing to the ApplyChangeFailed event to see if its running into a conflict?

    Friday, November 2, 2012 10:37 AM
    Moderator
  • yes tracking table is updating.Below data is a updated tracking table record on a  server but didnt sync to client during synchronization process.And ApplyChangeFailed is showing zero. 

    sequentialid uniqueidentifier - F5D7C5BD-D124-E211-B432-782BCB0480AE

    update_scope_local_id  -NULL

    scope_update_peer_key int -NULL
    scope_update_peer_timestamp -NULL
    local_update_peer_key int -0
    local_update_peer_timestamp-0x000000000293E223
    create_scope_local_id int -NULL
    scope_create_peer_key int -NULL
    scope_create_peer_timestamp-NULL
    local_create_peer_key int -0
    local_create_peer_timestamp -43246115
    sync_row_is_tombstone int -0
    restore_timestamp bigint -NULL
    last_change_datetime datetime - 2012-11-02 05:43:24.350

    Friday, November 2, 2012 11:06 AM
  • if you want to debug it, subscribe to the ChangesSelected event of the provider that's pointing to the server and subscribe to the ApplyChangeFailed event of the provider connected to the client database.

    the ChangesSelected would tell you if the change is being picked up. ApplyChangeFailed event will tell you if it has problems applying the change.

    Friday, November 2, 2012 12:06 PM
    Moderator