locked
Is data "lost" from a synchronized SDF after a reinitialization recoverable? RRS feed

  • Question

  • We have a legacy application on SQLMobile 3.5. 

    There was a schema update over the weekend and the instruction to all subscribers was to sync before work after the update. 90% of clients did so.

    However 10% did not.

    We're now getting reports of lost data between the schema update and next sync. Users who synced following the update and went to work are fine.

    All indications of a re-initialised subscription without upload.

    Is the captured data post schema update and next sync recoverable in any way from the SDF? Is it stored as an uncyncable record or is it "synced away" never to be seen again?

    I think I know the answer but I thought I'd ask.

    regards

    Andrew

    Monday, December 3, 2018 1:39 AM

All replies

  • Assuming you are using Merge Replication, there is no automated way to recover the data on the client SDFs that was not synchronized before recreating the publication.

    Depending on the importance of data information and the number of affected devices, you may consider develop a simple application, that pick a SDF file, and on "critical" tables looks for unsynchronized records (each table has a few extra columns with such information) and from there creates INSERT / UPDATE / DELETE instructions to be performed on the server database. I would suggest that each client sends you it SDF so that centrally you can run the generated SQL command.

    The mentioned app may be created on the latest Visual Studio, provided that you have SQL Compact installed on that machine.

    Feel free to ping if you need more clarification or if you need professional help to develop such application.


    Alberto Silva / www.moving2u.pt - R&D Manager / Former Microsoft MVP (2003-2015)


    Monday, December 3, 2018 11:04 AM
  • Thanks Alberto. Unfortunately I'm all too familiar with manual recovery from SDF.

    I suppose my question more correctly phrased if a snaphot has been reinitialized and the "upload changes" was not set are ANY of the records captured in the SDF that were captured POST reinitialization and AFTER synchronization lost?

    Looking at the SDF it looks like it's simply a download of the existing database overwriting the captured data.

    Monday, December 3, 2018 1:47 PM
  • Hi Andy,

    Sorry, don't know the answer to your question. 

    Regards,

    Alberto


    Alberto Silva / www.moving2u.pt - R&D Manager / Former Microsoft MVP (2003-2015)

    • Proposed as answer by Teige Gao Tuesday, December 4, 2018 7:15 AM
    • Unproposed as answer by Teige Gao Tuesday, December 4, 2018 7:15 AM
    Monday, December 3, 2018 2:50 PM
  • Yes, local data will be overwritten, unless you use the uploadbeforeinitialize option, https://docs.microsoft.com/en-us/previous-versions/sql/compact/sql-server-compact-3.5/az5z4w46%28v%3dvs.90%29 - my SQL Server Compact Merge library is set up to do just that https://github.com/ErikEJ/SqlCeMergeLib 

    Please mark as answer, if this was it. Visit my SQL Server Compact blog http://erikej.blogspot.com

    Sunday, December 23, 2018 12:41 PM