Thursday, February 12, 2009

Testing SCR

The following information will help when testing SCR failover to the DR server. The server, file and path locations have been kept simple, so the syntax is easier to understand.

Production Info
Server: EXMBX1
Storage Group: SG1
Storage Group Path: S:\SG1
Database Name: Store1
Database File: S:\SG1\Store1.edb
Log Path: L:\SG1
System Path: L:\SG1

DR Information for Failover
Server: DRMBX1
Storage Group: SG1
Storage Group Path: S:\SG1
Database Name: DB1
Database File: S:\SG1\DB1.edb
Log Path: L:\SG1
System Path: L:\SG1

DR Information for Move Back
Server: DRMBX1
Storage Group: SG1
Storage Group Path: S:\Recovery\SG1\
Database Name: DB1
Database File: S:\Recovery\SG1\DB1.edb
System Path: L:\Recovery\SG1
Log Path: L:\Recovery\SG1

FAILOVER TO DR

1. Dismount the test store database in production
dismount-Database EXMBX1\SG1\Db1 -Confirm:$False

2. Make database available to DR server
Restore-StorageGroupCopy –Identity EXMBX1\SG1 –StandbyMachine DRMBX1 -Force

3. Check that the database is in dirty shutdown
eseutil /mh "S:\SG1\DB1.edb" findstr State

NOTE: Database will always be in a ‘Dirty Shutdown’ state. A soft recovery will need to be run to commit the log files to the database. In order to commit the logs to the database, it is required to check the log folder for what generation the logs are. Eg E0A

4. Open command prompt with admin privileges, change to database folder S:\Program Files\Microsoft\Exchange Server\Test and run:
eseutil /R E0A /L "L:\SG1" (this will error out)
eseutil /R E0A /L "L:\SG1" /a

5. Check integrity again (See step 3) Now that the database is in a ‘Clean Shutdown’ the system path and log path for the storage group needs to be changed.
move-storageGroupPath DRMBX1\SG1 -SystemFolderPath "L:\SG1 -LogFolderPath "L:\SG1 -configurationonly -confirm:$False

6. Also change the database path for the store
move-databasepath DRMBX1\SG1\DB1 -edbfilepath "S:\SG1\DB1.edb" -configurationonly -confirm:$False

7. Set database on DR server to allow a restore to the database
Set-MailboxDatabase DRMBX1\SG1\DB1 -AllowFileRestore:$true

8. Mount the database on the DR server
Mount-Database DB1

9. Moves all users in the database to point to the DR server
Get-Mailbox -Database EXMBX1\SG1\DB1 where {$_.objectClass -NotMatch '(SystemAttendantMailbox ExOleDBSystemMailbox)'} Move-Mailbox -ConfigurationOnly -TargetDatabase DRMBX1\SG1\DB1 -Confirm:$false

MOVE BACK TO PRODUCTION

1. Dismount database on DR server
2. Delete database file and log files from production server location
3. Delete checkpoint file
4. Copy over the database from DR server to production server. Check to make sure the database is in a ‘Clean Shutdown’ state
5. On the production server database check 'This database can be overwritten by a restore' or run from the production server:
Set-MailboxDatabase EXMBX1\SG1 \DB1 -AllowFileRestore:$True
6. Mount database
7. Point users back to production server
Get-Mailbox -Database DRMBX1\SG1\DB1 where {$_.objectClass -NotMatch '(SystemAttendantMailbox ExOleDBSystemMailbox)'} Move-Mailbox -ConfigurationOnly -TargetDatabase EXMBX1\SG1\DB1 -Confirm:$false

REBUILD SCR REPLICATION

1. Delete database, log and checkpoint files on the DR server
2. Change system path and logs back to old location
move-storageGroupPath DRMBX1\SG1 -SystemFolderPath L:\Recovery\SG1 -LogFolderPath L:\Recovery\SG1 -configurationonly -confirm:$False
3. Change the database path for the store
move-databasepath DRMBX1\SG1\DB1 -edbfilepath "S:\Recovery\SG1\DB1.edb" -configurationonly -confirm:$False
4. Enable storage group copy
Enable-StorageGroupCopy EXMBX1\SG1 -StandbyMachine DRMBX1 -ReplayLagTime 0.0:0:0 5. Suspend the storage group copy before re-seeding the database
Suspend-StorageGroupCopy EXMBX1\SG1 –StandbyMachine DRMBX1
6. Re-seed the database
Update-StorageGroupCopy EXMBX1\SG1 –StandbyMachine DRMBX1
7. Resume storage group copy
Resume-StorageGroupCopy EXMBX1\SG1 –StandbyMachine DRMBX1

No comments: