
Backing Up and Restoring the Publication Database
There are two approaches to restoring a merge publication database. After restoring the publication database from a backup, you should either:
-
Synchronize the publication database with a subscription database.
-
Reinitialize all subscriptions to the publications in the publication database.
Using either of these methods ensures that after a restore is performed, the Publisher and all Subscribers are synchronized.
Note: |
|---|
|
If any tables contain identity columns, you must ensure the correct identity ranges are assigned after a restore. For more information, see Replicating Identity Columns.
|
Synchronizing the Publication Database
Synchronizing a publication database with a subscription database allows you to upload from one or more subscription databases those changes made previously in the publication database, but not represented in the restored backup. The data that can be uploaded depends on the way in which a publication is filtered:
-
If the publication is not filtered, you should be able to bring the publication database up-to-date by synchronizing with the most up-to-date Subscriber.
-
If the publication is filtered, you might not be able to bring the publication database up-to-date. Consider a table that is partitioned such that each subscription receives customer data only for a single region: North, East, South, and West. If there is at least one Subscriber for each partition of data, synchronizing with a Subscriber for each partition should bring the publication database up-to-date. However, if data in the West partition, for example, was not replicated to any Subscribers, this data at the Publisher cannot be brought up-to-date.
Important: |
|---|
|
Synchronizing a publication database with a subscription database can result in published tables being restored to a point in time that is more recent than the point in time of other non-published tables restored from the backup.
|
If you synchronize with a Subscriber that is running a version of Microsoft SQL Server prior to Microsoft SQL Server 2005, the subscription cannot be anonymous; it must be a client subscription or server subscription (referred to as local subscriptions and global subscriptions in previous releases).
To synchronize a subscription
Reinitializing all Subscriptions
Reinitializing all subscriptions ensures all Subscribers are in a state consistent with the restored publication database. This approach should be used if you want to return an entire topology to the previous state represented by a given publication database backup. For example, you might want to reinitialize all subscriptions if you are restoring a publication database to an earlier point in time as a mechanism to recover from an erroneously performed batch operation.
If you choose this option, generate a new snapshot for delivery to reinitialized Subscribers immediately after restoring your publication database.
To reinitialize a subscription
To create and apply a snapshot