Home > General > Snapshot without Snap Manager for Exchange

Snapshot without Snap Manager for Exchange

February 3rd, 2009

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 scripted API for the Exchange VSS writer, but we can do warm backups of Exchange.

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.

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

General , , ,

  1. No comments yet.
  1. No trackbacks yet.



This site is not affiliated or sponsored in anyway by NetApp or any other company mentioned within.
%d bloggers like this: