Standby Continuous Replication (SCR)
Part 1 Standalone Server to Standalone Server using Database Portability
Exchange 2007 SP1 has added some additional functionality to Exchange 2007. A new featured called Standby Continuous Replication (SCR) provides the ability that is similar to CCR and LCR but expands the limits of those two technologies.
Lets define LCR and CCR and see how SCR expands upon them:
LCR – Local Continuous Replication
http://technet.microsoft.com/en-us/library/bb125195.aspx
CCR – Cluster Continuous Replication
http://technet.microsoft.com/en-us/library/bb124521.aspx
Since the Beta 2 release of Exchange 2007 SP1 SCR functionality has been included in the product. http://technet.microsoft.com/en-us/library/bb676502.aspx.
What can SCR do for me?
SCR allows an Exchange Admin to replicate a copy of a Storage Group to a number of remote servers. Microsoft recommends a max of 4 target machines.
An SCR Source can be an LCR,CCR,SCC, or Stand alone mailbox server but requires only 1 Database per Storage Group which is already a requirement for LCR and CCR.
The target can be on the same subnet or in a remote datacenter unlike CCR which currently requires both nodes be on the same subnet (this will change with Windows 2008)
SCR requires manual intervention to bring the remote server(s) online, this solution is not an instant on scenario.
Lets start to work with SCR……
Scenario 1 – Stand alone MBX server Source -> Stand alone MBX target
————————————————————————–
Lab Environment:
1 Windows 2003 SP2 DC
1 CAS/Hub Running Exchange 2007 SP1 Beta 2 build 177.3
2 MBX server Running Exchange 2007 SP1 Beta 2 build 177.3
There are only a few requirements for SCR:
1. the paths must be the same for both machines
– If source server is c:\Server1\Data and C:\Server1\Logs then these paths must be available on the target server.
2. There is a hard coded 50 log lag between the Source and Target
– by default there is a 24 hour replay time which is configurable.
3. There can be only 1 database per storage group
4. The target server must have Exchange mailbox role installed, if this is a cluster it will be install as a passive node.
5. The target server must be in the same Active Directory domain
On my source mailbox server I have created 2 storage groups with 1 database each
**Note the Path to the DB and logs are as follows
D:\SCR\SG1\Data
D:\SCR\SG1\logs
D:\SCR\SG2\Data
D:\SCR\SGs\logs
To enable SCR replication we need to open EMS and run the following command:
Enable-StorageGroupCopy -identity Storagegroup -standbymachine TargetServerName 
** I also ran this command for SG2 and added some additional switches**
After a few moments the same path is created on the remote server seen below.
** There are some new switches to the Enable-StroageGroupCopy command in SP1 related to SCR replaylagtime and TruncationLagTime.
Replaylagtime- Time that the Microsoft Exchange Replication Service should wait before replaying logs. Default is 24 hours and max time is 7 days.
TruncationLagTime- Amount of time Microsoft Exchange Replication Service waits before truncating log files that have been copied to the target
We can validate this by running:
Get-storagegroupcopystatus -standbymachine TargetServerName
** note it take a few minutes to get the replication started **
now that replication has started and is healthy lets take a look at our target server logs folder:
I then used Loadgenerator ( http://technet.microsoft.com/en-us/exchange/bb330849.aspx.) which can be downloaded from MS to generate some logs file on my machine so I could get past the hard coded 50 log lag before the replay started.
You can see a copy of the database has been created on my target server
To bring an SCR replica online there are 3 options:
(Search the help file for “Activating Standby Continous Replication Clusters)
http://technet.microsoft.com/en-us/library/bb691321.aspx.
1. Database Portability
2. Recover CMS (for clusters only)
3. RecoverServer
Now that we have setup replication we are going to use database portability to bring these 2 databases back online on are target server.
Lets start by creating a new storage group and database on our target server
* Note this path will be different then the destination of replica *
As you can see below I chose to locate the logs D:\SCR\Recover\logs and systemfiles D:\SCR\Recover\Data
I have placed the database D:\SCR\Recover\Data
After the database has been created, mount it one time and then dismount the database.
Now we need to dismount our current source database
**Note if the source has crashed or is offline you can skip this command*
Dismount-Database vmmbx1\vmmbx1-sg2\vmmbx1-sg2-db1
Now we must make the scr target database mountable with the Restore-StorageGroupCopy cmdlet
Restore-StorageGroupCopy vmmbx1\vmmbx1-sg2 -StandbyMachine Scrtarget -force
Important:
If the SCR source is not available, the Force parameter must be added
Before we can bring the target database online we need to verify that the database is in a cleanshutdown state.
To do this we will use ESEUTIL (by deafult this is located in the (systemdrive)c:\program files\microsoft\Exchange Server\Bin directory)
Open a command prompt:
ESEUTIL /MH d:\scr\sg2\data\vmmbx1-sg2-db1.edb (path to edb file)

*Note we have a State of “Dirty Shutdown” and must repair our edb file*
If the db shows dirty we will need to do a recovery with ESEUTIL /R to get the state to Clean
ESEUTIL /R E01 (Zero Zero or whatever the logs file leads with) /l D:\SCR\SG2\Logs /S D:\SCR\SG2\Data

** Note you may receive an error about lossy failover and need to a the /a switch as seen in the screenshot above**
Now we need to modify our command with the /a switch
ESEUTIL /R E01 (Zero Zero or whatever the logs file leads with) /l D:\SCR\SG2\Logs /S D:\SCR\SG2\Data /a

Now lets check our state with ESEUTIL /MH again and you see we are now in a “Clean Shutdown”
Now we need to move the Storage Group info of our Temp SG to the location of the replicated logs
Move-StorageGroupPath Target\SG -SystemFolderPath D:\SCR\SG2\Data -LogFolderPath D:\SCR\SG2\logs -ConfigurationOnly

Now we need to move the Database info of our Temp DB to the location of the replicated database
Move-DatabasePath Target\TempSG\TempDB -EdbFilePath D:\SCR\SG1\DATA\vmmbx1-vmmbx1-db2.EDB -ConfigurationOnly
**Note the edb file is the name of the replicated edb file**

Now we have to set the DB to be overwritten this can be done in the gui or from EMS, since we are at the command line I will use EMS:
Set-Mailboxdatabase SCRTARGET\RECOVER\RECOVERDB -AllowFileRestore:$true
Lets attempt to bring the database onilne:
Mount-Database SCRTarget\RECOVER\RECOVERDB
We can now see that our database has been brought online and we are only 1 step away from giving the client access again!
After the database is mounted, the user mailboxes homed on the SCR source database must be re-homed to theTarget Server
Get-Mailbox -Database vmmbx1\vmmbx1-SG2\vmmbx1-sg2-db1 ¦ where {$_.ObjectClass -NotMatch ‘(SystemAttendantMailboxExOleDbSystemMailbox)’} ¦ Move-Mailbox -ConfigurationOnly -TargetDatabase SCRTarget\Recover\recoverdb
You will see the user configuration being moved to the new location
Clients should now be able to access their mailbox depending on several factors:
Active Directory replication latency
CAS server has been updated with the correct information
OL 2007 will use autodiscover to find the mbx
However OL 2003 will not automatically configure the client unless the old server is still online and can be contacted.
Let look in the gui and see the db location of some of our users
We can see that our user now show that their mailboxes belong to our Recover Database
Let logon to OWA to validate the users can access their email
The screen shot below showthe users logon information from OWA– Selection Options-About
We can see our mbx is on the new server SCRTarget and OWA logon was successful
Lets logon with Outlook 2007 and see if it connect and finds the correct mailbox
We have now successfully recovered our users using Exchange 2007s newest feature Standby Continuous Replication.
I want to note that many of the tasks above can be added to a script so that only 1 command has to be run which will rapidly improve recovery time.

















September 7th, 2007 at 3:43 pm
Nice work, Brian!
September 10th, 2007 at 5:50 am
Excellent work Brian – this is very useful information!
Matt Ward
September 10th, 2007 at 6:47 am
I had some problems setting up SCR in my lab. The database did not seed on the target machine. The workaround I came up with was Suspend-StorageGroupCopy SGName -StandbyMachine Target, delete all log files from Target, Update-StorageGroupCopy SGName -StandbyMachine Target (from Target), and Resume-StorageGroupCopy SGName -StandbyMachine Target
September 13th, 2007 at 11:16 pm
Gr8 work Brian.
Have a question for you.
What will happen to already connected users. I am sure outlook with go in Offline line mode. What do we need to do from client/end user prospective to get them connected automatically. Changing manually the server name, its a difficult thing on every end user desktops.
Thanks
Rahul
September 14th, 2007 at 1:48 pm
rahulxarora,
The answer really depends upon the client that you are using, OWA and Outlook 2007 (as long as autodiscover is working) will work with out any problem however legacy like Outlook 2003 will have problems only if the original server is no longer online.
September 14th, 2007 at 2:26 pm
rahulxarora,
I forgot to mention, if you use the /serverrecover switch you can use the same server name to removes any client configuration changes. I am currently working on my next article related to that SCR option.
September 26th, 2007 at 4:19 pm
Very useful information.
About how long does it take to run the Set-Mailboxdatabase SCRTARGET\RECOVER\RECOVERDB -AllowFileRestore:$true
and the
Mount-Database SCRTarget\RECOVER\RECOVERDB
commands?
If a primary email server dies, then what kind of time frame is realistic for getting a passive SCR machine up and running? 30 Min?
September 26th, 2007 at 5:25 pm
I would say there are a number of factors that will dictate that answer.
Which method would you use database portability, /recoverserver, or /recovercms each has its steps?
Also I have just recieved new code and want to rerun my tests. A fix has been deployed so that eseutil may not have to be run.
I would say you could script many of the manual tasks to speed up the process and if you have large db that require eseutil that will take time.
I dont want to be vague but the time it will take will vary for each person.
April 15th, 2008 at 2:38 am
Hi! I’ve been looking for really useful info on the web, but I could rarely find the ones which are useful… luckily i found your blog about Exchange SCR! This is really fantastic!!!
I hope you’ll share more info as good as this in your upcoming blogs
Gerald Elizalde
May 6th, 2008 at 10:10 pm
Is it possible to use SCR on a combined HTS/Mailbox server?
May 7th, 2008 at 2:00 pm
How long should it take to seed a 80gb storage group over a 100mb wan link?
I’ve successfully seeded a couple of my sg’s that are all they same size and it literally took 2-3 days. Is that normal????
May 7th, 2008 at 2:01 pm
How long should it take to seed an 80gb storage group ober a 100mb wan link?
I’ve seeded a couple of my SG’s that are all about the same size, and they literally took 2 or 3 days to finish???? Is this normal?
May 7th, 2008 at 6:36 pm
I dont believe there are any issues with combo roles, in beta one node was a combo and worked
May 7th, 2008 at 6:38 pm
Willis,
I would say no that is not normal however the are a number of factors mainly bandwith. You have a 100mb link but how saturated is it?
How taxed are the boxes currently?
May 20th, 2008 at 5:58 am
Hi!I have an issue after enabling SCR which is my Database will not seeded automatically and through error such as “The Database not found after log replay Source:MSExchangeRepl event ID:2106″…Plz help me….
May 20th, 2008 at 7:55 am
This is some great information; thanks for the effort!
I have setup SCR and it seems to be working correctly; going to test the changeover this evening from our production CCR mailbox server to the SCR Target in a different subnet & AD site.
Hopefully this is an easy question, but I cannot seem to find the answer aynwhere:
I have a huge amount of log files replicated from the CMS to the SCR target. I know that once the SCR target has 50, it replays these into the DB, and the SCR Db is the same size as the production Db.
My question (finally) is: HOw do I make the SCR Target purge those log files it’s already used?
June 10th, 2008 at 9:45 am
Brillant Post thank you,
I have set SCR up now and have it seeded to the DR site, but when I use get-stroagegroupcopy status -standbymachine etc, it says not configured.
Just set it up and left defaults for relay time so may have to wait 24 hours to see action on logs etc, but this has me a touch concerned thoughts?
June 10th, 2008 at 6:02 pm
Which machine are you running the command from? Also the log copy should start as soon as you have everything setup so the target should be recieving logs.
June 11th, 2008 at 4:45 am
I was running the cmd from the target machine. Ran it again same machine still same answer not configured. No logs as of yet. It seeded and created the log folder,
and mail database folder / file .
Ran the enable-storage etc cmd from the target as well originally.
Lost as to why it’s not replicating. thoughts going forward? THx Greg
June 11th, 2008 at 5:36 am
Ok, i Have been setting it up on 2 pairs of servers. I ran the suspend, then update on one pair and now the logs are there. Then ran the get status on the source and got healthy. So all good there. Other pair gave me no valid replication string message, and appeared not to have scr configured despite seeding etc. so I have disabled and manually deleted seeded folders files on target server, but when I run the enable it tells me the logs already exist etc. running enable on target server. Love ex2K7 but SCR is getting me down
June 11th, 2008 at 11:57 am
Update, have 1st pair working now.
Was able to re-seed second pair, suspend, then update, but if I go to source machine and run the get status cmd it says not configured. Also there are no logs in the target log folder.
Greg
June 17th, 2008 at 10:30 am
Got it! For some reason dispite having SCR disabled it would recreate the database, and log folder. However I broke down and renamed the source storage group and database. then moved to new folder paths etc. Ran through enable , seed process and all good now. Thanks,
Greg
June 24th, 2008 at 12:00 pm
Can you have multiple sources on one target? If so, what are the drawbacks?
June 24th, 2008 at 2:00 pm
Yes, you can have multiple source sever -> one target….. draw back would depend, you need to have the same paths on sources and target this would limite you to database portability unless you went through a bucnh of hoops.
July 9th, 2008 at 4:07 am
Should the log file prefix of the source storage group and the target storage group should be same.
I have successfully activated target database on scr server but the log file prefix was different. Because i have activated the sixth storage group database and on the target scr already there were two storage group.
How can we change the log file prefix of a storage group?
September 23rd, 2008 at 2:02 pm
Do you have to have LCR enabled before enabling SCR?
My Exchange is saying LCR is not enabled so it cannot enable the storagecopy.
October 3rd, 2008 at 8:51 am
Nice work.
One question, i have two exchange 2K7 server with two databases. Is it possible for each server to be source and target of each other ?
N.B
October 3rd, 2008 at 11:31 am
Yes you can do that and use database portability to bring them online. I guess one question is are these both local or in 2 offices. If local you may want to think of using CCR which would be much better for you.
October 29th, 2008 at 3:37 pm
Thanks heaps for this article!
I’ve just run through all the steps successfully, but it fails right at the last hurdle.
When I try to mount the DB I get an Active Directory error. The server I am mounting it on is a DC/GC, however the source server was the PDC and holds all the FSMO roles – do I need to transfer the roles for the DB to mount? Tried rebooting and leaving it unmounted for a period of time with no luck – and after the reboot the Information Store service won’t even start…
Now, when I stop all the exchange services on the source server and re-enable the NIC – the services all start and the DB mounts. This suggests to me that the target server NEEDS to have the PDC online for the recover to work. If this is true, I’m a little disappointed as I thought SCR was meant to be an easy way to replicate exchange and recover quickly.
Really appreciate any comment on the situation.
Cheers,
Matt
http://mattlog.net
November 9th, 2008 at 10:35 pm
great work..very insightful.
quick question.
how do we go back to the original server?
-remove any trace of the original SG and DB by deleting the SG and DB? and setup SCR again?
November 10th, 2008 at 4:37 pm
I guess the answer would depend on the failure however yes you can just clean up the server and get everything functional, a simple move mailbox would work to bring the users back you could also do the process in reverse. There is a technet article that walks you through
December 5th, 2008 at 4:31 pm
Brian,
Can you explain what the /a switch does when running eseutil with a lossy failover? I can’t seem to find it documented.
December 6th, 2008 at 8:26 am
this article has a good break down
http://www.computerperformance.co.uk/exchange2007/exchange2007_eseutil.htm
May 13th, 2009 at 2:20 pm
Saravanan you have to disable the firewall in both servers
September 7th, 2009 at 8:07 pm
Hi,
I have implemented this SCR feature on my exchange servers. I just want to know how it would be helpful for me when my source exchange server will not available due to any reason. Let me suppose I have just shutdown my server to test and then I am trying to login on owa. but i am not able to login because my mail box store is on my source server. So what to do here?.
My next query is which ports i need to open through my windows firewall in both servers for replication.
I have successfully performed the all above steps but when I am checking the copystatus it is showing Disabled, I have already run the “Resume-StorageGroupCopy” command. but after that it’s showing disabled.
Thanks
Johal
November 11th, 2009 at 11:06 pm
HI ,
Will you please tell me which ports need to open between source & target server if there is firewall between them……….
Thanks in advance
November 12th, 2009 at 8:49 am
Log shipping (CCR/SCR) uses SMB = TCP 445.
Data Path Security Reference
http://technet.microsoft.com/en-us/library/bb331973.aspx
November 21st, 2009 at 7:31 am
Just to say that you’re a life saver…
Thanks for the Post.
December 4th, 2009 at 11:44 am
Thanks, great post.
“I want to note that many of the tasks above can be added to a script so that only 1 command has to be run which will rapidly improve recovery time.”
Is this available somewhere? Is there a script for failback too? Thought I’d ask before getting my hands dirty.
December 4th, 2009 at 3:35 pm
I would have to double check, as I wrote this one when 2007 sp1 was in Beta.
December 7th, 2009 at 4:13 pm
Hi guys, is there a script available to automate or make this fail over easier?
December 7th, 2009 at 4:14 pm
hi guys, i’m trying to find out how to create a script for Powershell so that the failover task can be done in one hit
help please
January 26th, 2010 at 3:53 pm
Quick question: Would like to enable SCR but OS version is Windows 2008 Standard/Exchange 2007 SP2 (on VM)? Do I need Windows 2008 Enterprise version for SCR? T hanks.
January 27th, 2010 at 8:48 am
My answer would depend on the configuration you deploy, however if you want the remote target to be a stand alone server there is no dependency on clustering and you should be able to use standard edition