# Basic Backup of Exchange Databases
Exchange 2007 SP2 includes a new plug-in that enables you to make Volume Shadow Copy Service (VSS)-based backups of Exchange data using Windows Server Backup in Windows Server 2008.
* Advanced Mode
<1> Click to select the check box for any drive, folder or file that you want to back up, expand Microsoft Exchange Server
==========================================================================
Restore NTbackup
# allow overwritten by running the following Exchange
Set-MailboxDatabase <restored_database> -AllowFileRestore $true
** In the Restore files to list, select the location where you want the files restored. By default, the location specified is Original location.
# After the database has been restored, mount it
Mount-Database <restored_database>
# Remove the Do not mount this database at startup setting
Set-MailboxDatabase <restored_database> -MountAtStartUp $true
==========================================================================
recovery storage group (RSG)
* recover data from a backup or copy of a database without disturbing user access to current data.
Mailboxes that are in a database that has been mounted in an RSG cannot be connected to Active Directory directory service accounts. These mailboxes have to be merged into existing mailboxes, or copied to a folder in an existing mailbox.
System and mailbox management policies are not applied. This design prevents items in an RSG from being deleted by the system while you are trying to salvage them.
RSGs are not appropriate to use under the following conditions:
You have to recover public folder content. Only mailbox databases are supported.
You have to restore entire servers, one storage group at a time.
You have to restore databases from multiple storage groups.
Restore-Mailbox cmdlet:
mode:
Merge mode
Copy to a subfolder
parameter:
MailboxGuid The Exchange Mailbox GUID of the mailbox to recover.
The Restore-Mailbox cmdlet can only use disconnected mailboxes as a source of data and connected mailboxes as a target for data.
To recover a Microsoft Exchange 2007 mailbox, the recovered .edb and .log files need to be attached to the Recovery Storage Group in Exchange and you must use Exchange-supported tools, such as Exmerge.exe, to extract a .pst file.
Recover a Mailbox
=================
-----------------------
When an RSG is present, restores are redirected to the RSG. This is transparent to NTBackup. Here are a few links:
Make sure you uncheck any public stores/databases (in ntbackup) during the restore as you cannot restore public store databases to an RSG and will result in a database not found error.
You also don't want to mount the newly created RSG database before the restore.
-----------------------
<1> create RSG
new-storagegroup -Server <Server_Name> -LogFolderPath <path_to_Logfiles> -Name <RSG_Name> -SystemFolderPath <Database_Path> -Recovery
LogFolderPath (optional)
# <ExchangeInstallPath>\Mailbox\<StorageGroupName>
SystemFolderPath (Optional)
# <ExchangeInstallPath>\Mailbox\<StorageGroupName>
* -Recovery
# The Recovery parameter specifies that the new group is designated as a recovery storage group.
** C:\Program Files\Microsoft\Exchange Server
*** check: Get-StorageGroup
<2> Add a recovery database to the RSG
new-mailboxdatabase -mailboxdatabasetorecover <Database_Name> -storagegroup <Server_Name>\<RSG_Name> -EDBFilePath <Database_Path>
* required if you are recovering a mailbox database
* storage group where the mailbox database will be created.
* EDBFilePath(Optional): path to the .edb file.
The default value is \Mailbox\<Storage Group name>\<Database name>.edb
<3> Set the recovery database to allow overwrites
set-mailboxdatabase -identity <Server_Name>\<RSG_Name>\<Database_Name> -AllowFileRestore:$True
<4> Mount the recovery database
mount-database -identity <Server_Name>\<RSG_Name>\<Database_Name>
Get-MailboxDatabase -status | ft name,storagegroup,mounted
Mailbox Database NS2\First Storage Group True
Mailbox Database NS2\my_rsg False
run a ESEUTIL /P then /D and ISINTEG on the restored mail database restored to the recovery storage group.
Mount-Database : Exchange is unable to mount the database that you specified. S
pecified database: NS2\my_rsg\Mailbox Database; Error code: MapiExceptionCallFa
iled: Unable to mount database. (hr=0x80004005, ec=-544).
<5> repair it
ESEUTIL /p "Mailbox Database.edb"
<6> restore a mailbox in an RSG into a different active mailbox
# John Smith ---> Allison Brown(Folder: JSmith Email)
Restore-Mailbox -RSGMailbox 'John Smith' -RSGDatabase 'MyServer\RSG\Mailbox Database' -id 'Allison Brown' -TargetFolder 'JSmith Email'
Confirm
Are you sure you want to perform this action?
Recovering mailbox content from the mailbox 'John Smith' in the recovery
database 'MyServer\RSG\Mailbox Database' into the mailbox for 'Allison Brown
(Allison.Brown@XXXXX)'. The operation can take a long time to
complete.
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help
(default is "Y"):
Allison Brown
Moving messages. Deleted Items (467/593)
[o ]
OR
<6> Recover the mailbox of an existing user to an existing mailbox
Restore-Mailbox -identity 'John Smith' -RSGDatabase 'RSG\mailbox database'
Remove a RSG
=============
# dismount
Dismount-Database "Server\<RSG_Name>\Mailbox Database"
# mailbox database
Remove-MailboxDatabase -identity <Server_Name>\<RSG_Name>\<Database_Name>
output:
WARNING: The specified database has been removed. You must remove the database
file located in C:\Program Files\Microsoft\Exchange
Server\Mailbox\my_rsg\Mailbox Database.edb from your computer manually if it
exists. Specified database: Mailbox Database
# Remove the RSG
Remove-Storagegroup -identity "<Server_Name>\<RSG_Name>"
==========================================================================