Sql-server – Re-subscribing to a merge publication after edits made offline

mergereplicationsql-server-2008

Hypothetical Question – To help scenario planning.

Let's say I have a 2008 R2 Merge Publication with 5 active subscribers. The publication is deleted and all subscriptions are removed. A week or so goes by and data is continually added or updated on the local databases that used to be subscribers.

A week later a new publication is created on the original database and the 5 local boxes are all given new subscriptions. What happens to the data that was added locally during the week no subscription existed?

  • A: Is it uploaded to the publisher once the new subscription is created?

  • B: Is the data from the week offline deleted?

  • C: Is the data from the week offline ignored by the publisher (and hence other subscribers)?

  • D: Something else happens

If C? Is there a way to mark those records for replication so they can be brought up to the publisher, and ultimately the other subscribers?

Best Answer

None of the above.

If the 5 new subscriptions are initialized with a snapshot then by default all subscription database objects will be dropped and recreated from the snapshot bcp files. So the data from the week offline will appear to be deleted.

If C? Is there a way to mark those records for replication so they can be brought up to the publisher, and ultimately the other subscribers?

With Merge there is an option to upload pending changes before reinitialization but since your subscriptions have been removed you won't have this option.

The way to handle this is to manually sync the databases using tablediff utility or Red Gate's SQL Data Compare. Then recreate the publication from the manually merged database - then subscriptions.