Migrating SQL Server Transactional Replication to another server

  • We are migrating our Instance to another Server. Our SQL Server Transactional Replication Publication resides on the instance that we are moving to another server. We push to the subscriber. The distribution database sit's on another server and we want that to stay like it is. When I script out the Replication and then install on the server we are moving to will I have to re-establish outside of the script the location of the distributor database or is this part of the replication script. It's not obvious to me.

  • ericwenger1 - Sunday, February 3, 2019 5:06 AM

    We are migrating our Instance to another Server. Our SQL Server Transactional Replication Publication resides on the instance that we are moving to another server. We push to the subscriber. The distribution database sit's on another server and we want that to stay like it is. When I script out the Replication and then install on the server we are moving to will I have to re-establish outside of the script the location of the distributor database or is this part of the replication script. It's not obvious to me.

    If you use SSMS to generate the scripts, what you get in the scripts depends on which folder you do the Generate Scripts from. If you generate the scripts from the Replication folder, you can see the distributor scripts specified to run on the publisher. You wouldn't need to execute sp_adddistributiondb since it's already created. If you did just that stored procedure it would error on that stored procedure telling you it already exists so it's not going to create duplicates. The following document shows the t-sql commands for this part of setting this up including sp_adddistributor and sp_adddistpublisher which you would execute on the publisher server in the master database:
    sp_adddistributor (Transact-SQL)

    Here is another example on setting this up with t-sql:
    Walkthrough setting up SQL Replication Distributor using TSQL commands

    Sue

  • Thank you so much!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply