Pages

Saturday, February 18, 2012

How to initialize the subscriber from backup

Here is the step by step procedure on how to initalize subscriber from backup

  1. Create the publication using user interface Replication Wizard.
  2. Under subscription options for the publication, set “allow initialization from backup files” to true
  3. Create a new full backup of the publisher database. If you have existing full backup of the publisher database, you can still use that backup set but we have take a new log backup or differential backup of the publisher database and restore at the subscriber.
  4. Replication UI does not allow the option to create the subscription to allow initialization from back. We have to TSQL when creating the subscription.
    exec sp_addsubscription @publication = N'Repl2000', …..
    @sync_type = N'initialize with backup',
    @backupdevicetype='Disk',
    @backupdevicename='C:\Repl2000_RestoreThis.bak'--this is the last backup used to restore on the subscriber that was taken after the publication was created
    go
    exec sp_addpushsubscription_agent …….
    go

  5. This should create the subscription and the Distribution agent should be replicating the commands successfully.

No comments:

Post a Comment