none
Skip Initial Sync :PerformPostRestoreFixup(). RRS feed

  • Question

  • Hi,

    I am working on sync framework 2.1, using sqlsyncprovider to sync sql server 2005 and sql server 2008.

    my database is large for initial sync. If I do following steps, Will the sync service stop the initial data sync and start from incremental changes ?

    1. Do provisioning on sql server 2005 database.
    2. Backup the source database using TSQL or manually
    3. Restore the back on the sql server 2008 (manually)
    4. Create a SqlSyncStoreRestore object and invoke PerformPostRestoreFixup() on sql sever 2008.

    Plz advice!!


    ess

    Thursday, April 4, 2013 1:09 AM

All replies

  • yes, that should do it.

    if you have a large database to do PerformPostRestoreFixup, make sure to set the CommandTimeout on the SqlSyncStoreRestore object as well.

    Thursday, April 4, 2013 11:06 AM
    Moderator
  • Is there any bug related to performpostrestorefix  functionality,  that Microsoft fixed and released a hot fix.

    I read at somewhere . I want to confirm with you.


    ess

    Thursday, April 4, 2013 11:29 AM
  • Thursday, April 4, 2013 12:10 PM
    Moderator
  • My sql server 2005 db has two scopes .......Will PerformPostRestoreFixup works? 

    is following code perform restore fix for both the scopes?

    sqlConnection serverConn = new SqlConnection(sql server 2008 connection string);
                SqlConnection.ClearPool(serverConn);
               
                SqlSyncStoreRestore databaseRestore = new SqlSyncStoreRestore(serverConn);
                databaseRestore.CommandTimeout = 10000;
                databaseRestore.PerformPostRestoreFixup();
                databaseRestore.
                serverConn.Close();
                serverConn.Dispose();


    ess


    • Edited by saitrips Thursday, April 4, 2013 1:37 PM
    Thursday, April 4, 2013 1:36 PM
  • the fixup is at the database level. if you have multiple scopes in that database, then it should work for all scopes in the database.
    Thursday, April 4, 2013 2:55 PM
    Moderator
  • I completes back and restore step.

    But mistakenly I called PerformPostRestoreFixup on sql server 2005(source). Its still running. I waiting for it to be finished.

    Is this fine or it is a rule that we have to run the PerformPostRestoreFixup only on restored database.


    ess

    Thursday, April 4, 2013 3:10 PM
  • that should be fine
    Thursday, April 4, 2013 3:30 PM
    Moderator
  • sync is still taking long time for one scope.

    below is sync trace. get knowledge call to remote provider is taking longtime and is timing out

    000000000000 17 25m 1s 11:23:40 AM 11:48:42 AM
    Construct ChannelFactory. Contract type: 'ThunderCloudClient.IWelcome'. 4 15ms 11:23:40 AM 11:23:40 AM
    Process action 'http://tempuri.org/IRelationalSyncContract/Initialize'. 12 218ms 11:23:40 AM 11:23:40 AM
    Open ChannelFactory. Contract type: 'ThunderCloudClient.IWelcome'. 4 0ms 11:23:40 AM 11:23:40 AM
    Processing message 1. 5 0ms 11:23:40 AM 11:23:40 AM
    Process action 'http://tempuri.org/IRelationalSyncContract/BeginSession'. 8 31ms 11:23:41 AM 11:23:41 AM
    Process action 'http://tempuri.org/IRelationalSyncContract/GetKnowledge'. 8 15ms 11:23:41 AM 11:23:41 AM
    Receive bytes on connection 'http://dev-sync-connect.xosdigital.com/Service1.svc'. 12 12m 30s 11:36:11 AM 11:48:42 AM
    Processing message 2. 5 0ms 11:36:11 AM 11:36:11 AM
    Process action 'http://schemas.xmlsoap.org/ws/2005/02/rm/SequenceAcknowledgement'. 4 0ms 11:36:11 AM 11:36:11 AM
    Processing message 3. 5 0ms 11:48:42 AM 11:48:42 AM
    Process action 'http://www.w3.org/2005/08/addressing/soap/fault'. 4 0ms 11:48:42 AM 11:48:42 AM


    ess


    • Edited by saitrips Thursday, April 4, 2013 3:59 PM
    Thursday, April 4, 2013 3:59 PM
  • if you do lots of deletes and if you also have many replicas, the sync knowledge will be fragmented and bigger. you can compact it by regularly running metadata cleanup.

    Thursday, April 4, 2013 4:07 PM
    Moderator
  • and also I observed after running some fast sucessfull sync. suddenly get knowledge call response takes lot of time.

    is it bcz sync knowledge size. how to clean sync knowledge?


    ess

    Thursday, April 4, 2013 4:09 PM
  • as i have mentioned, you should run regular metadata cleanup to help reduce the size of the sync knowledge. just look it up in the documentation.
    Thursday, April 4, 2013 11:51 PM
    Moderator
  • SqlConnection clientConn = new SqlConnection(localConnection);
     SqlSyncStoreRestore databaseRestore = new SqlSyncStoreRestore(clientConn);
      databaseRestore.CommandTimeout = 100000;
    databaseRestore.PerformPostRestoreFixup();

    When I run this code, internally in sync fx what will happens? Metadatacleanup means it only delete rows from tracking table that are deleted from primary table

    scope_info Table in sync Fx has "scope_sync_knowledge" column.Initial it will be null and grows with sync running.

    Will I get any performance gain If I update scope_sync_knowledge column to NULL at end of the day every time!!


    ess

    Friday, April 5, 2013 1:28 PM
  • you set that to null and you might as well forget doing a perform post restore fixup. that column stores metadata on what has been synched and that's why you can do incremental syncs.

    Friday, April 5, 2013 3:21 PM
    Moderator