Exchange 2007 Recovery Storage Group
Exchange 2007 Recovery Storage Group : utilizing power shell
Microsoft introduced the Recovery Storage Group with Exchange 2003 which added some nice recovery functionality; we no longer needed a recovery AD forest to restore items to mailboxes or a single mailbox. Exchange 2007 has kept this feature however has drastically changed the interface and added the ability to use power shell for recovery.
For this article I am going to focus on using power shell only to recover mailboxes and messages to a mailbox. One big change is that even when a RSG is created you will not see it with the gui (EMC) and it can only been see via power shell.
First let’s start by logging onto a mailbox and seeing the content

As you can see we have 3 new messages in Jodie’s mailbox
Now we can use NTBackup to backup our Exchange servers database
1. Launch NTBackup from the system tools

2. Select next on the backup/restore wizard

3. Choose the radius button to backup files and settings
4. Select the radius button “Let me choose what to backup”

5. I am only going to backup the first storage group since that is the location of mymailboxes

6. Specify the location of the backup (D:\backup)

7. Click finish to start the backup
Here we can see our backup file has been created.

Now that we have a current backup I am going to delete the messages from Jodie’s mailbox so that we can then use a recovery storage group to recover the data .
Lets create a new RSG and take a look in the gui and then the command line.
To create an RSG we use the new-storagegroup commad but add the -Recover switch
new-storagegroup -Server vmmbx1 -LogFolderPath d:\rsg\logs -Name ExchangeGenie
-SystemFolderPath d:\rsg\data -Recovery

now that we have created our RSG let see if we get any info from EMC
As you can see the RSG does not show up
but if we do a get-storgegroup fl our new RSG will be shown
notice the recovery option is set to true
Now that we have created an RSG we need to add the database we want to recover
new-mailboxdatabase -mailboxdatabasetorecover “Mailbox Database” -storagegroup Vmmbx1\ExchangeGenie -edbfilepath “D:\RSG\Data\mailbox database.edb”

We do not need to set this database can be overwritten since that is enabled by default.
Now that we have created our RSG and added the appropriate database to the RSG we now have to restore the data from backup.
3. Select the backup we want to restore

4. input a temp location for the patch file and Check “Last Restore”
**since this is a full backup and no other logs are to be restored the last restore check box is marked”***

5. Click Next to start the restore

6. Click close after the restore completes

You can see we now have data restored to our recovery database location.

Now that the data has been restored from our backup we need to mount the recovery database
mount-database -identity ‘vmmbx1\exchangegenie\mailbox database’

Now that we have created our RSG, added a recovery database, and restored our data from backup we can now recover data to our users mailbox.
I will perform 3 different recoveries
1. Merge data back into a users mailbox
2. Merge data back into a sub folder in the users mailbox
3. Merge data to another users mailbox into a subfolder
Merge Data back to the original location
The following command will merge the data from our recovery database back to the original live mailbox.
Restore-Mailbox -id ‘Jodie Bartos’ -RSGDatabase ‘ExchangeGenie\Mailbox Database’
Merge data into a sub folder in a users mailbox
Restore-Mailbox -RSGMailbox ‘Jodie Bartos’ -RSGDatabase ‘ExchangeGenie\Mailbox Database’ -id ‘Jodie.Bartos’ -targetfolder ‘RestoredMail’

You can see we have a new folder called RestoredMail which has a copy of the user inbox
Restore-Mailbox -RSGMailbo ‘Jodie Bartos’ -RSGDatabase ‘ExchangeGenie\Mailbox Database’ -id ‘Brian.Tirch’-targetfolder ‘JodiesMbx’


















![[Google]]( http://www.exchange-genie.com/wp-content/plugins/easy-adsenser/google-light.gif)
January 12th, 2008 at 8:36 pm
HELP!!
Short Version:
I have a database from a restore that I need to somehow reintegrate, but paths have been moved around and I’m not clear where to start.
Long Version: I had a single Domain Controller, Single Exchange 2007 Server with All Roles, and a Single Exchange 2007 SP Edge Server. My users mailboxes were on a local disk M: drive (and I think the log files for the First Storage Group were on the C Drive in the default location).
I archived my exchange vm, and upgraded it to Exchange 2007 SP1.
I then set up a remote iscsi server and migrated all of my users mailboxes to that machine.
Fast forward 3 weeks.
The iscsi server suffered a disk problem and the Raid was running in degraded mode so I migrated everything back to the original local disk M:.
THEN a totally unrelated catastrophy occurred.
My VM Server suffered some data loss during some snapshot removal, and my exchange vm was no longer bootable. the Windows installation was HORKED!
But the mailboxes were all safe on a the second local vm hard disk M:.
To make a long story short the exchange vm was a total loss, so i had to revert to the image which was 3 weeks old. I then upgraded the retored copy to SP1.
If I try and log into Outlook 2007 I get a disconnected status after repeated attempts to connect, OWA says the mailbox is unavailble because it is being migrated.
If I create a new Database in First Storage Group mount it then create a new user that user works fine to log into OWA (havent tried Outlook but at this point OWA is good enough!!!), the new user can send and receive with no problems.
I have copied the old database and log files back to the degraded iscsi server, they are also on the M: drive, but I cant begin to figure out where I need to start to get the mailboxes connected back to the user accounts.
HELP!!!
January 13th, 2008 at 9:23 am
blogs are hard to troubleshoot on, I do answer questions on exchange-experts and is a good forum for that.
I would treat this as a database portability issue….
there are a few ways to handle this
1. make sure deleted item retension is on and delete the mbx and reconnect it
2. use database portablity to move the database, this will update the users info in AD and should fix the problem my blog on SCR had the steps to move the database in it
http://exchange-genie.blogspot.com/2007/08/scr-standby-continuous-replication.html
January 22nd, 2008 at 9:31 am
Hi,
nice article with screenshots.
I would inform you that you have some typos in your commands to merge mailbox data
Ex.: -RSGMailbo (x missing)
I would suggest that you could explain better how the command is used when restoring mailbox into another mailbox folder:
Restore-Mailbox -Identity ‘TargetMailboxName’ -RSGDatabase ‘Servername\RecoveryStorageGroupName\Mailbox Database’ -RSGMailbox ‘SourceMailbox’ -targetfolder ‘RestorefolderofTargetMailbox’
Greetings
January 23rd, 2008 at 7:29 am
Wanted to say thank you very much! This article was exactly what I needed. Now I can press on with my migration from exch03 without having to worry about backups and restores.
Thanks again.
Clyde Burns
January 23rd, 2008 at 2:31 pm
nepoz, thanks for the edit, I am sure I have a bunch of typos on here since I have written many of these late night….
As far as explaining what is going on, what type of information are you looking for?
Brian
March 18th, 2008 at 2:30 pm
Nicely done and highly applicable to my last step before our official 03-07 migration!
March 26th, 2008 at 12:49 am
thank you for your article, it was a great help!
May 27th, 2008 at 5:22 am
Greetings !
I have successfully restored several times using the ExTRA, however my last attempt has resulted in my not being able to dismount the database in the recovery storage group. Although the dismount completes correctly when I attempt to remove the recovery storage group it says the database is still mounted. Caught in a loop. Help !!!
June 18th, 2008 at 11:23 am
kris, I had the same problem when trying to dismount the database from the Database Recovery Management tool in the Toolbox(GUI). It said it dismounted the db successfully but in fact it wasn’t! I got around it by dismounting the db and removing the recovery storage group from the Management Shell. Check out the commands above in this writeup for the Shell commands you need.
August 29th, 2008 at 12:52 am
This article is exactly what I needed. Moreover it is well explained. Thanks…
October 16th, 2008 at 12:23 pm
Hi,
I have trouble finding a user in the RSG.
I use:
Get-mailbox -identity “username” RSGdatabase “RSGPATH”
I find some users but some users not
I can see these users that i am trying to find in the disconnected Mailboxes that they are in the RSG
I will a presiate some comments to thes matter..
Thanks
/Moisés
October 16th, 2008 at 2:32 pm
If your having trouble in the shell, try the gui wizard and see what is returned
November 26th, 2008 at 2:44 pm
Is there a similar work around for a user which was deleted out of AD?
November 26th, 2008 at 3:14 pm
out of the box no, however 3rd part tools like quest can assist. In Windows 7 (next windows release) you will be able to recover deleted objects from AD without 3rd party.
May 30th, 2009 at 12:29 pm
I found your blog on google and read a few of your other posts. I just added you to my Google News Reader. Keep up the good work. Look forward to reading more from you in the future.
September 16th, 2009 at 11:08 am
Awesome tutorial, worked perfect for me
February 11th, 2010 at 1:31 pm
Hi
Great article but a quick question, if I have a clean shutdown database (mailbox.edb) on a backup which I can restore to a different domain’s exchange server’s hard disk
can I then create the rsg and restore some mailboxes out of it
Exchange 2007 edb, server 2008, different domain
any thoughts ?
Keep up the writing work as your site is full of great articles.
Kind Regards
February 11th, 2010 at 9:59 pm
I am curious why you would wont to exclude those mailboxes as there are still functional mailboxes and would be aport of the count?
February 11th, 2010 at 10:00 pm
Could you walk me through your scenario that you are trying to do… Is there a particular reason why you want to do this in a differnt AD environment? What are you descibing is how it was done before we had RSG, in Exchange 2000 you would setup a recovery forest to restore to.
July 21st, 2010 at 2:03 am
Nice article.
Is there a way to specify a different location where the RSG is created?
I’ve tried setting in ExTRA but am unable to since it keeps on looking for an existing database file.
- louie
July 21st, 2010 at 12:27 pm
I would have to look in the gui and test since its been some time since I have worked with 2007 however you can do this from the shell which you can see in the blog posting.