SQL Server 2008 R2

If a Microsoft SQL Server 2008 R2 Publisher is restored from backup, SQL Server Compact 3.5 Subscribers can continue to synchronize with the Publisher without having to reinitialize. Any changes that have been made on the Subscriber are uploaded during the next synchronization so that no data loss occurs.

There are two types of data recovery that can occur: the Publisher is restored from backup, or the Subscriber is restored from backup.

Recovering if the Publisher is Restored

When a SQL Server 2008 Publisher is restored from a backup, each SQL Server Compact 3.5 Subscriber is notified at the next synchronization that a restore has occurred. All Subscriber changes that may have occurred since the Publisher was backed up are re-sent to the Publisher.

Each SQL Server Compact 3.5 Subscriber only resends data changes that were made on that specific device. If data changes have been made directly on the Publisher or on subscribers other than SQL Server Compact 3.5 Subscribers, you must synchronize the Publisher with a SQL Server Subscriber to fully restore the Publisher.

There are three cases where restoration is not possible without forcing a reinitialization of the Subscriber. These cases are:

  1. The schema has changed since the last back up was made.

  2. The subscription has expired.

  3. A subscriber tracking row does not exist on the Publisher for the particular Subscriber. For example, when you copy a Subscriber to a new supported device and that new Subscriber has not yet synchronized with the Publisher.

If any one of these three cases is met, reinitialization of the Subscriber must occur.

Recovering if the Subscriber is Restored

Your SQL Server Compact 3.5 application can make regular backups of the SQL Server Compact 3.5 database in case the supported device fails or loses power. You can restore your SQL Server Compact 3.5 database from this backup. Because the Publisher does not know that the Subscriber has been restored, it treats the next synchronization exactly like a regular synchronization. All information on the Publisher that is missing from the Subscriber is re-sent to the Subscriber. The Subscriber is then fully restored.

A Subscriber will not re-receive changes from the Publisher that originated from the Subscriber. Any time a restore occurs, perform synchronization with filter validation. If the row count does not match, you must reinitialize.