Reinitializing Subscriptions

SQL Replication

Replication

Reinitializing Subscriptions

When a subscription is marked for reinitialization, the snapshot schema and data are applied at the Subscriber after the next time the Snapshot Agent prepares a snapshot and Distribution Agent (for snapshot replication or transactional replication) applies it or the Merge Agent (for merge replication) runs.

For example, merge replication Subscribers update data based on the original snapshot provided to them unless you mark the subscription for reinitialization. When you mark the subscription for reinitialization, the next time the Merge Agent runs, it will apply the most recent snapshot to the Subscriber.

By default, a new snapshot is applied at the Subscriber as the first step on the next synchronization after it is marked for reinitialization. This means that any changes made at the Subscriber, but not yet synchronized with the Publisher, will be overwritten by the application of the new snapshot. Merge replication provides an option that can preserve the changes made at a Subscriber for which subscriptions are being reinitialized.

If you have a subscription to a merge publication, you can choose to have all the data changes uploaded from the Subscriber before the snapshot is reapplied. Any updates that have been made at the Subscriber since the last synchronization will be propagated to the Publisher before the snapshot is reapplied.

If you created a subscription and indicated no initial snapshot was to be applied to the Subscriber (specifying in the Create Push Subscription or Create Pull Subscription Wizard that the Subscriber already has the schema and data), and you reinitialize the subscription, the most recent snapshot will be applied to the Subscriber.

This functionality ensures that Subscribers have data and schema identical to data and schema at the Publisher. To prevent the reapplication of the snapshot to the Subscriber, drop the subscription specified with no initial snapshot synchronization and then re-create it after the reinitialization of any other Subscribers.

Reinitialization of push subscriptions is administered at the Publisher, while reinitialization of pull subscriptions is administered at the Subscriber.

Note  At this stage, it is easy to confuse reinitialize with synchronize. Reinitialize marks the subscription. The next time the subscription is synchronized (the Distribution Agent or Merge Agent runs), the snapshot will be reapplied at the Subscriber.

To reinitialize a subscription