Subscribe

Exchange Snapshots without SME

I wanted to open this up as a discussion thread in case people have encountered other ways to achieve this, or had feedback from customers of how they achieved this.

Unfortunately there are rare cases where a customer either does not want Snap Manager for Exchange, or cannot afford it. I’m not going to try and attempt to write a full scripted API for the Exchange VSS writer, the below script is very simple! The script is a totally disruptive way of snapshotting the mailstores relatively cleanly. I give no guarantees to the full consistency of these backups (although they should be good). If you want a full and proper backup solution, get SME!

I love SME and it breaks my heart whenever customers take it out of a config! I can't stress enough how much I think it shouldn't be a choice, but a requirement that SME is used. But still, I have to try accomodate everyone. I'd rather they bought NetApp hardware in the first place, so at least it's a start!

The following few scripts can help with this, a couple of VBscripts which will dismount and mount the Exchange stores allowing you to take a NetApp based snapshot with a batch script, and so getting a consistent backup point. I would recommend running this only once a day, and only on a system that can suffer disruption!


In the below scripts we connect to an Exchange server called “EXCHANGE”, which sits in the domain called “domain.lan”. There are 2 mailstores (”Mailbox Store” and “Public Folder Store”) inside 1 storage group (”First Storage Group”). These are easily customised, changed or added to. We don’t touch the logs volumes, we can take “dirty” snapshots directly on the filer fairly safely without any disruption or application integration really required. But you may want another process to clear down the transaction logs.

First script “ExchDismount.vbs” using VB to connect to the Exchange server and dismount the mailstores.

Set oDB = CreateObject(”CDOEXM.MailboxStoreDB”)

strDB = “CN=Mailbox Store (EXCHANGE),CN=First Storage Group,CN=InformationStore,CN=EXCHANGE,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=domain,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=domain,DC=lan”

oDB.DataSource.Open strDB
oDB.Dismount()

Set oPS = CreateObject(”CDOEXM.PublicStoreDB”)

strPS = “CN=Public Folder Store (EXCHANGE),CN=First Storage Group,CN=InformationStore,CN=EXCHANGE,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=domain,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=domain,DC=lan”

oPS.DataSource.Open strPS
oPS.Dismount()

A second VB script “ExchMount.vbs” is then used to connect to the Exchange server and remount the mailstores.

Set oDB = CreateObject(”CDOEXM.MailboxStoreDB”)

strDB = “CN=Mailbox Store (EXCHANGE),CN=First Storage Group,CN=InformationStore,CN=EXCHANGE,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=domain,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=domain,DC=lan”

oDB.DataSource.Open strDB
oDB.Mount()

Set oPS = CreateObject(”CDOEXM.PublicStoreDB”)

strPS = “CN=Public Folder Store (EXCHANGE),CN=First Storage Group,CN=InformationStore,CN=EXCHANGE,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=domain,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=domain,DC=lan”

oPS.DataSource.Open strPS
oPS.Mount()

We pull this all together around a quick snapshot batch script that will create a series of daily snaps (in this case 5). This can be run from a scheduled task daily in the night, or during a time where disruption can be tollerated. The snapshots have a prefix defined at the top, as is the database drive letter. If multiple Storage Groups are going to be snapshotted, then this script will need to be expanded on, or multiple scripts to stagger the disruption.

@echo off
REM —— begin

snapprefix=exch
dbdrive=M

echo * Create new snapshot, and rename older snapshots, deleting last one *
“C:\Program Files\NetApp\SnapDrive\sdcli.exe” snap rename -d %dbdrive% -o %snapprefix%.daily.5 -n %snapprefix%.daily.delete
“C:\Program Files\NetApp\SnapDrive\sdcli.exe” snap rename -d %dbdrive% -o %snapprefix%.daily.4 -n %snapprefix%.daily.5
“C:\Program Files\NetApp\SnapDrive\sdcli.exe” snap rename -d %dbdrive% -o %snapprefix%.daily.3 -n %snapprefix%.daily.4
“C:\Program Files\NetApp\SnapDrive\sdcli.exe” snap rename -d %dbdrive% -o %snapprefix%.daily.2 -n %snapprefix%.daily.3
“C:\Program Files\NetApp\SnapDrive\sdcli.exe” snap rename -d %dbdrive% -o %snapprefix%.daily.1 -n %snapprefix%.daily.2

ExchDismount.vbs
“C:\Program Files\NetApp\SnapDrive\sdcli.exe” snap create -s %snapprefix%.daily.1 -D %dbdrive%
ExchMount.vbs

“C:\Program Files\NetApp\SnapDrive\sdcli.exe” snap delete -d %dbdrive% -s %snapprefix%.daily.delete

REM —— end

Going on from this, I reckon it wouldn't be too difficult to script a Flex Clone and ESEUTIL verification of the database.

Re: Exchange Snapshots without SME

Hello,

We are in the midst of transitioning storage and backup strategies and have a need for a quick way to get consistant (restorable) snaps on a 2010 Exchange server.

Scenario:

  1. SME with Host Utils etc. is installed (but not yet configured for backups as Commvault is currently managing it for retension reasons etc), to be replaced with SME/NetApp later in the project.

  1. Seperate iSCSI volumes for MAIL DB, Public Folder DB and LOGS.

I notice that if I creat a backup with sdcli.exe the resulting backups are marked consistant. The Question is: in a pinch can I restore from these backups as a last ditch effort (are they actually usable). Since we are in the middle of moving things around i'd like a way to quickly backup and restore Exchange in the interim incase of an emegeancy..

This post mensions using the .vbs to take the store off and then put it back on-line. Is this actually necesarry if the snaps are maked consistant?

I'd like to schedule snap creates and snap deletes without taking the store on and off-line, is this a workable scenario?

Lastly on snap deletes IE: "sdcli snap delete -D p m s -s TestSnap" I get a message that says the "Mount point is missing ..." however the same exact sysntax is listed in the Admin Guide. If I use a lower case d (-d) and specify only one drive letter it works. Is this a bug or did I get the syntax wrong? I did try putting the snap name in front of the mount point but same issue IE: "sdcli snap delete -s TestSnap -D p m s ". It only seems to take one drive letter at a time with a lower case "-d".

Thanks for any help.

Scott

Re: Exchange Snapshots without SME

Sorry to bring up an old thread, but I'm looking to also do snapshots of Exchange.

I'm looking at the scripts here

http://gallery.technet.microsoft.com/office/VSSTesterps1-script-4ed07243

Explained here

http://blogs.technet.com/b/exchange/archive/2013/04/29/troubleshoot-your-exchange-2010-database-backup-functionality-with-vsstester-script.aspx

I figure if we can use the Exchange VSS Writer to freeze the data, then we can run sdcli to snapshot the data, then use the VSS writer to thaw.

Thoughts?

Re: Exchange Snapshots without SME

[ Edited ]

So, here's what worked.

 

The script goes about deleting and renaming snapshots, and here's how I take my snapshot...

 

Set objCmd = objWShell.Exec("C:\Windows\System32\diskshadow /s C:\backup\DiskShadowFreezeSnapThaw.txt /l C:\backup\diskshadow-log.txt")

 

The contents of DiskShadowFreezeSnapThaw.txt

 

#Require Exchange writer

writer verify {76fe1ac4-15f7-4bcd-987e-8e1acb462fb7}

#Take snapshot

add volume m: alias vss_exchangedb

begin backup

create

EXEC c:\backup\NetappSnap.cmd

end backup

 

The contents of NetappSnap.cmd - I get the current hour, and I have to trim the leading space on single digit hours.

set hr=%time:~0,2%

if "%time:~0,1%"==" " (set hr=%time:~1,1%)

sdclie.exe snap create -m MAILBOX-1 s MAILBOX-1.hourly.%hr% -D M: -x

 

Hope this helps someone!