Wednesday, March 26, 2008

Cross Domain SQL Replication in a trusted environment

Howdy, this is quite a break from my usual posts, but addresses a problem I recently managed to "solve".

Scenario: You are working in an environment with 2 domains, and the domains trust eachother. You wish to get replication working from SQLA in DomainA to SQLB in DomainB, but SQL Server replication does not allow FQDNs. I am presenting SQLA as the publisher, and SQLB as the subscriber.

The first thing you need to do is ensure that the publisher is set to save the snapshot to a UNC. I still use the default path, but make it a share (C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\repldata becomes \\SQLA\repldata). With the share permissions set properly this will enable the subscriber to get to the snapshot.

The next thing you need to do is a hack. I say this without shame because it should not be necessary. In the hosts file on SQLB you need to add an entry for SQLA. If the FQDN for SQLA is sqla.domaina.com with an ip of 192.168.65.101 then the whole point is so that you only need to use "sqla", so your hosts file entry on SQLB should look like

192.168.65.101 SQLA

If SQLA needs to be able to communicate with SQLB, a similar hack may be needed there.


Once that is done you should be able to get replication working. Keep in mind that if you are changing the default location for any existing publications from the drive path to the UNC that the snapshot will need to be regenerated before that goes into effect.

Thanks, and please let me know if this was useful.

No comments: