How to replicate Exchange 2003 with Symantec Replication Exec
This article explains how to achieve Exchange 2003 database replication without using MSCS cluster. Replication Exec 3.1 can be used to replicate Exchange database between two exchange servers so that a cold DR Exchange server is kept up-to-date with the live exchange server. This is brought to you by Shijaz Abdulla.
Background
Veritas Replication Exec 3.1 (now from Symantec) is a file replication tool. It can be used for configuring jobs for replicating the contents of folders between two or more machines. For more information on Veritas ReplicationExec, please visit Symantec Website.
Before you follow this procedure, please make sure that you have understood the Veritas Replication Exec 3.1 whitepaper that describes how to setup replication for Exchange using MSCS.
As per the whitepaper, one needs to set up two MSCS clusters, each with one node (not one cluster with two nodes). One single node cluster would be for the primary server and the other would be for the secondary server. Both clusters would be identical with respect to virtual name and virtual IP. Under normal conditions only the primary server cluster would be online. The secondary (DR) exchange server cluster would be left offline. Veritas Replication Exec would be configured for continuous replication of data between primary and secondary servers.
The main reason for using single node cluster is because the same (virtual) name can be used on the same network for both servers, as at any given point of time, only one cluster would be online. This is required because, in the event of a disaster, the secondary server has to be available to all users by the same name since the Exchange Server name is mentioned at many places within the AD. However, most server SCSI hardware will not permit you to have a single node MSCS installed since a shareable SCSI bus is required.
This article investigates on how you can achieve this without having to install single node MSCS, i.e. without having to use a common (virtual) name and IP for the primary and secondary servers.
Step 1. Install Exchange 2003
- Install Exchange 2003 on both primary and secondary servers. In our example, the primary server is EXCH and the secondary (DR) server is EXCHDR. Our Windows domain name is MYDOMAIN.LOCAL
- Make sure that the latest Exchange Service Pack is installed on both servers. The service pack level should be the same on both primary and secondary exchange servers.
- On EXCHDR, stop all Exchange Services and change the startup mode to Manual.
- It is a good practice to configure Exchange database and logs on separate volumes on the same server or at least in different folders. In our example, the Exchang database will be in D:\EXCHDATA and the Exchange logs will be in D:\EXCHLOGS on both servers.
Step 2. Install Veritas Replication Exec 3.1
- Install Veritas Replication Exec 3.1. Installation is fairly straightforward. Make sure that the Replication Agents are installed on both Exchange servers. For more information on Veritas RE installation, see your Veritas RE documentation.
Step 3. Configure Veritas RE Replication jobs
- On the computer where you have installed Veritas Replication Manager, open the Veritas Replication Exec Console.
- Create a new replication job using New Job Wizard.
- Create a One-to-One (standard) replication job.
- Select the options as follows: Prescan, No changes on target, Exact replica on target, Continue Replicating After Synchronization.
- Specify the source as the primary Exchange server (EXCH) and the destination as the secondary Exchange server (EXCHDR).
- Specify the data to be replicated. It is recommended to replicate the entire EXCHSRVR directory for each disk containing Exchange data or log files. Replication Exec will select a default path on the Target unless you manually override the Target path. You must configure the replication job so the source and target paths are as per what is configured on each Exchange server as the local path for data and logs. Create a set of rules with a custom Target path. (in this example the NTFS Drive that Exchange was installed on happened to be the D: Drive, Hence map D:\exchdata as well as D:\exchlogs to the respective data and logs location on the secondary Exchange server.)
- Test the replication and check if the Exchange files are being replicated. You can perform additional steps for checking database consistency as explained in the Veritas Whitepaper.
Step 4. Writing SCRIPT 1: Changing mailbox home to DR server
NOTE: This script needs to be run only in the event of a disaster. Write the script, test it and store it in a safe place.
- Use a text editor like notepad and write a VBS script that achieves the following:
- Save the file with .VBS extension. Here is my VBS script (you can start here and modify, especially the words in italics) :
Option Explicit
Dim objOU, objUser, objRootDSE
Dim strContainer, strDNSDomain, strhomeMDB, strhomeMTA, strmsExchHomeServerName
Dim intCounter, intPwdValue‘ Bind to Active Directory Domain
Set objRootDSE = GetObject(“LDAP://mydc1.mydomain.local/RootDSE”)
strDNSDomain = objRootDSE.Get(“DefaultNamingContext”)Â
‘————————————————————
‘ Important change OU= to reflect your domain
‘————————————————————
strContainer = “OU=Accounts, ”
strContainer = strContainer & strDNSDomainintCounter = 0 strhomeMDB = “CN=Mailbox Store (EXCHDR),CN=First Storage Group,CN=InformationStore,CN=EXCHDR,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=MYORG,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=mydomain,DC=local”strhomeMTA = “CN=Microsoft MTA,CN=EXCHDR,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=MYORG,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=mydomain,DC=local”strmsExchHomeServerName = “/o=MYORG/ou=First Administrative Group/cn=Configuration/cn=Servers/cn=EXCHDR”
‘ Loop through OU=, setting all user accounts
‘ —————————————————-
set objOU =GetObject(“LDAP://” & strContainer )
For each objUser in objOU
If objUser.class=”user” then
objUser.Put “homeMDB”, strhomeMDB
objUser.SetInfo
objUser.Put “homeMTA”, strhomeMTA
objUser.SetInfo
objuser.Put “msExchHomeServerName”, strmsExchHomeServerName
objuser.SetInfo
End If
intCounter = intCounter + 1
Next
‘ —————————————————-
‘ Optional section to record how many accounts have been set
WScript.Echo “User Accounts changed = ” & intCounter
WScript.Quit
Replace MYORG with your Exchange organization name. Also take note of the places where I have mentioned domain names and exchange server names.
- This script needs to be run on the domain controller only in the event of a disaster. The user running the script must have administrator privileges on the domain. The scripts tell the AD that EXCHDR is currently holding the mailboxes. Changes are made to the schema, i.e. the homeMDB, homeMTA and msExchHomeServerName attributes on the user object are changed to point to the DR server.
TIP: You can use the same script to revert back, once you have recovered your primary exchange. Just replace EXCHDR with EXCH in the script. While reverting back you also need to do a reverse-replication using Veritas RE. For more information, see your Veritas documentation.
Step 5. Writing SCRIPT2: Telling Outlook clients to look at DR server
NOTE: This script needs to be run only in the event of a disaster. Write the script, test it and store it in a safe place.
- Download and install the Office Resource Kit (ORK) (7.1 MB) from the Microsoft Website and install it on any one of your client machines. We will be using the ORK to generate the script for us. Once generated, we can use the script on any client.
- Under Office Resource Kit tools, you will find the Custom Maintenance Wizard.
- In the Custom Maintenance Wizard, keep clicking Next till you reach the Outlook: Customize Default Profile page,
- Click New Profile, click Next. (Tip: You can also use Modify profile)
- On the Outlook: Specify Exchange Settings page, specify Configure an Exchange Server Connection.
- Specify your secondary Exchange server name (EXCHDR).
- At the end of the wizard you have the option of saving a PRF file. A .PRF file is an Outlook Profile file.
- When you double-click on the .PRF file from a client machine, it automatically reconfigures the Outlook profile to point to the secondary Exchange server. Put the execution of this .PRF file as a logon script in the event of a disaster.
TIP: You can use the same method to revert back by generating another .PRF, once you have recovered your primary exchange. While reverting back you also need to do a reverse-replication using Veritas RE. For more information, see your Veritas documentation.