locked
Changing Source Database Server in sync configuration RRS feed

  • Question

  • I am using sync services (.net 4.0) to bring down data from a server into a CE database allowing the users to manipulate the data locally or in a disconnected mode.  How do I move the client application into the production environment.  I am unable to get the client to sync with the production database and my logging shows that there is nothing to sync yet it is different data.  I am looking for a runtime solution that will detect a new source server, clear out the local cache (sqlce) and perform a new sync with the new server.  The part I am missing is the server detection(or a way to force the change)  While I have not read ALL the sync framework documentation, I have read a lot and search e a lot and cannot find any solution to this problem.  It seems to me that this would be a very simple process, but I could not find any methods that relate to changing the source database.

    Can someone point me in the right direction? 

    I see Sync Framework Category to post this in, but I don't see a forum for .Net 4 syncframework so this is my best shot and finding the correct forum.

    LD

    Thursday, April 7, 2011 10:42 PM

Answers

  • I am kinda surprised that there were no responses to this. 

    After going through the autogenerated code, it appeared that during the sync, the required tables would be created if they did not exist.  So, I cleared all the tables out of the CE database in the development environment and during the build process, the empty CE database was copied into the deployment folders.

    I launced the app against our production server and the sync performed as design including the creation of all the tables I had deleted earlier.  I had originally thought that all this would happen automatically when the sync service detected a different database, but I guess it just required a blank slate.

    So in the absence of any other insight, I will just code in a blank database anytime the target database changes which for right now in my situation is going from development to production.

    Maybe this will help someone else out there.

    LD

     

    • Marked as answer by Last Defense Tuesday, April 19, 2011 5:59 PM
    Tuesday, April 19, 2011 5:59 PM

All replies

  • I am kinda surprised that there were no responses to this. 

    After going through the autogenerated code, it appeared that during the sync, the required tables would be created if they did not exist.  So, I cleared all the tables out of the CE database in the development environment and during the build process, the empty CE database was copied into the deployment folders.

    I launced the app against our production server and the sync performed as design including the creation of all the tables I had deleted earlier.  I had originally thought that all this would happen automatically when the sync service detected a different database, but I guess it just required a blank slate.

    So in the absence of any other insight, I will just code in a blank database anytime the target database changes which for right now in my situation is going from development to production.

    Maybe this will help someone else out there.

    LD

     

    • Marked as answer by Last Defense Tuesday, April 19, 2011 5:59 PM
    Tuesday, April 19, 2011 5:59 PM
  • Hey,

    Can you clarify which version of Sync you are referring to. ".Net 4" is different from "Microsoft Sync Framework V4 CTP2". It seems you are using "Microsoft Sync Framework V4 CTP2".

    When you moving from development to production, you would have to provide a new Sync service URI to your clients. Anytime the new URI is provided, it looks like a new source and the initial sync will download all the data from the new Sync service URI. Currently I cannot think of anything in the MSF V4 CTP2 where by clients can detect if there's a new service available as there are no service discovery support. When you install the client for users, those client binaries need the service URI.

     

    Now you could make your app so that you can configure the service URI from command line or config file, so you don't have to recompile the client when sync service URI changes. So when you want to move your users to production from development, provide them a new config file.

    Hope this helps

    Sameer

     

    • Proposed as answer by Sameer[MSFT] Tuesday, April 19, 2011 6:30 PM
    Tuesday, April 19, 2011 6:30 PM
  • I am sorry, but that is probably my fault for the confusion.

    I am on VS 2010, X64; .NET 4.0; Microsoft Synchronization Runtime Version v2.0.50727,

    Sync Services and Ce were installed with SQL 2008 R2 Express.

    When I initialize the Sync provider, I pass the connection string for the server and the client.  I have no client config requirement and no recompile need when the server is changed.

    Does this answer your question?

    LD

    Tuesday, April 19, 2011 6:42 PM