RSS

不用第三方备份工具搞定exchange 2007在windows 2008上的备份

28 Apr

windows server 2008 内置的备份工具无法处理exhcange 2007的数据库备份问题。这个问题目前的处理方式有2个

1、使用第三方vss备份产品

2、将windows 2003的ntbackup挪到windows 2008上使用(实验用,生产环境千万别使用该方法)

—————

今天看到一位MVP写了个脚本来来搞定exchange 2007的备份任务。原文为Backing Up Exchange 2007 on Windows 2008

使用了2个脚本:

MBS-GUI-Exchange-backup.ps1

online-backup-GenerateForm.ps1

2个脚本放在同一个目录下,配合使用。online-backup-GenerateForm.ps1用于创建图形界面。

 

勾选2个选项后,点击prceed,后就开始备份了。

 

 

备份完后日志文件以及数据库。

备份的日志以及数据库:

——————–

这个脚本使用了diskshadow.exe(内置于windows 2008,跑在windows 2003会报错)

然后使用了一个脚本online-backup.cmd(脚本MBS-GUI-Exchange-backup.ps1生成的)

@echo off
echo Copying C:\Program Files\Microsoft\Exchange Server\Mailbox\Second Storage Group\Public Folder Database.edb...
robocopy "G:\Program Files\Microsoft\Exchange Server\Mailbox\Second Storage Group" "C:\Backups\2009-04-28-18-45-19\Program Files\Microsoft\Exchange Server\Mailbox\Second Storage Group" "Public Folder Database.edb" /copyall /ZB >nul
if not errorlevel 0 goto :abort
echo Copying C:\Program Files\Microsoft\Exchange Server\Mailbox\Second Storage Group\E01*.log...
robocopy "G:\Program Files\Microsoft\Exchange Server\Mailbox\Second Storage Group" "C:\Backups\2009-04-28-18-45-19\Program Files\Microsoft\Exchange Server\Mailbox\Second Storage Group" "E01*.log" /copyall /ZB >nul
if not errorlevel 0 goto :abort
echo Copying C:\Program Files\Microsoft\Exchange Server\Mailbox\Second Storage Group\E01.chk...
robocopy "G:\Program Files\Microsoft\Exchange Server\Mailbox\Second Storage Group" "C:\Backups\2009-04-28-18-45-19\Program Files\Microsoft\Exchange Server\Mailbox\Second Storage Group" "E01.chk" /copyall /ZB >nul
if not errorlevel 0 goto :abort
echo Copying C:\Program Files\Microsoft\Exchange Server\Mailbox\First Storage Group\Mailbox Database.edb...
robocopy "G:\Program Files\Microsoft\Exchange Server\Mailbox\First Storage Group" "C:\Backups\2009-04-28-18-45-19\Program Files\Microsoft\Exchange Server\Mailbox\First Storage Group" "Mailbox Database.edb" /copyall /ZB >nul
if not errorlevel 0 goto :abort
echo Copying C:\Program Files\Microsoft\Exchange Server\Mailbox\First Storage Group\E00*.log...
robocopy "G:\Program Files\Microsoft\Exchange Server\Mailbox\First Storage Group" "C:\Backups\2009-04-28-18-45-19\Program Files\Microsoft\Exchange Server\Mailbox\First Storage Group" "E00*.log" /copyall /ZB >nul
if not errorlevel 0 goto :abort
echo Copying C:\Program Files\Microsoft\Exchange Server\Mailbox\First Storage Group\E00.chk...
robocopy "G:\Program Files\Microsoft\Exchange Server\Mailbox\First Storage Group" "C:\Backups\2009-04-28-18-45-19\Program Files\Microsoft\Exchange Server\Mailbox\First Storage Group" "E00.chk" /copyall /ZB >nul
if not errorlevel 0 goto :abort
 
echo Checking C:\Backups\2009-04-28-18-45-19\Program Files\Microsoft\Exchange Server\Mailbox\Second Storage Group\Public Folder Database.edb...
call :checkit "C:\Backups\2009-04-28-18-45-19\Program Files\Microsoft\Exchange Server\Mailbox\Second Storage Group\Public Folder Database.edb "
if not errorlevel 0 goto :abort
echo Checking C:\Backups\2009-04-28-18-45-19\Program Files\Microsoft\Exchange Server\Mailbox\First Storage Group\Mailbox Database.edb...
call :checkit "C:\Backups\2009-04-28-18-45-19\Program Files\Microsoft\Exchange Server\Mailbox\First Storage Group\Mailbox Database.edb "
if not errorlevel 0 goto :abort
 
exit 0
:abort
exit 1
 
:checkit
eseutil /k %1 >nul
if not errorlevel 0 exit 1
echo Check succeeded!

还是用了另外一个脚本online-backup.dsh调用diskshadow.exe(脚本MBS-GUI-Exchange-backup.ps1生成的)

# Diskshadow backup script.
set verbose on
set context persistent
set metadata C:\Backups\2009-04-28-18-45-19\online-backup.cab
 
# verify presence of Exchange Writer
writer verify {76fe1ac4-15f7-4bcd-987e-8e1acb462fb7}
# exclude system writer
writer exclude {e8132975-6f93-4464-a53e-1050253ae220}
# exclude IIS config writer
writer exclude {2a40fd15-dfca-4aa8-a654-1f8c654603f6}
# exclude ASR writer
writer exclude {be000cbe-11fe-4426-9c58-531aa6355fc4}
# exclude BITS writer
writer exclude {4969d978-be47-48b0-b100-f328f07ac1e0}
# exclude WMI writer
writer exclude {a6ad56c2-b509-4e6c-bb19-49d8f43532f0}
# exclude registry writer
writer exclude {afbab4a2-367d-4d15-a586-71dbb18f8485}
# exclude iis metabase writer
writer exclude {59b1f0cf-90ef-465f-9609-6ca8b2938366}
# exclude com+ regdb writer
writer exclude {542da469-d3e1-473c-9f4f-7847f01fc64f}
# exclude shadow-copy optimization writer (does not apply to exchange)
writer exclude {4dc3bdd4-ab48-4d07-adb0-3bee2926fd7f}
 
begin backup
 
add volume C: alias shadow_C
 
create
 
expose %shadow_C% G:
 
exec C:\Users\ADMINI~1\AppData\Local\Temp\online-backup.cmd
end backup
delete shadows exposed G:
 
exit

——————-

还不知道如何进行数据还原,回头研究了再上文。

Advertisements
 
 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: