Thursday, January 27, 2011

How to complete basic backup of your OCS installation, including configuration and databases.

First we look at the configuration on the front end server. In this scenario we will complete backup of Front end and mediation server from the front end server. If you have additional servers they are easily added to this script.
  • First Create an folder on the C: drive of the FE server called “Backup”
  • Browse to the new folder “c:\Backup”
  • Create a new .bat file called “OCS-backup.bat”
  • Edit the .bat file
—– Content of OCS-backup.bat——–
“C:\Program Files\Common Files\Microsoft Office Communications Server 2007\lcscmd” /config /action:export /level:machine /configfile:c:\backup\[name of front-end server]-Serversettings.xml /fqdn:[fqdn of front-end server]

“C:\Program Files\Common Files\Microsoft Office Communications Server 2007\lcscmd” /config /action:export /level:machine /configfile:c:\backup\[name of mediation server]Serversettings.xml /fqdn:[fqdn of mediation server]

“C:\Program Files\Common Files\Microsoft Office Communications Server 2007\lcscmd” /config /action:export /level:pool /configfile:c:\backup\[poolname]-Pool.xml /poolname:[poolname]


“C:\Program Files\Common Files\Microsoft Office Communications Server 2007\lcscmd” /config /action:export /level:global /configfile:c:\backup\[poolname]-Global.xml /poolname:
[poolname]

“C:\Program Files\Common Files\Microsoft Office Communications Server 2007\lcscmd” /config /action:export /level:global,pool /configfile:c:\backup\[poolname]-GlobalAndPool.xml /poolname:
[poolname]
————END————-
Please note that the pool name is the same as the hostname of the Front End server in Standard Edition deployment.
  • Save the file and give it a test run. You should get 5 .xml files in c:\backup directory
Backup of the Access Edge server is very similar. It should be backed up, however it is not needed every day, depending on your company’s security requirements. Backing up configuration every time a change is applied to the server is a very good idea.
The command is the same as for the Mediation and Front End server:
——-Access Edge Backup——–
“C:\Program Files\Common Files\Microsoft Office Communications Server 2007\lcscmd” /config /action:export /level:machine /configfile:c:\backup\Serversettings.xml /fqdn:
——–END——–
Then we move to backing up SQL Databases:
If you have a backup application that supports SQL 2005, its possible to backup the databases directly.
If you are left without this tool, there are other ways. In this case i will describe the procedure for the Standard edition of OCS deployments, and there for assume that OCS is using an SQL 2005 Express.
First you need the Microsoft SQL Server Management Studio Express
  • Download and install the package on your Front End server
This enables you to view and generate SQL scripts. For this deployment, the below scripts will work:
———–RTC-backup.sql———–
BACKUP DATABASE [rtc] TO DISK = N’C:\Backup\rtc.bak’ WITH NOFORMAT, INIT, NAME = N’rtc-Full Database Backup’, SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO
—————END————–
———–RTCconfig-backup.sql———–
BACKUP DATABASE [rtcconfig] TO DISK = N’C:\Backup\rtcconfig.bak’ WITH NOFORMAT, INIT, NAME = N’rtcconfig-Full Database Backup’, SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO
—————END————–
———–RTCdyn-backup.sql———–
BACKUP DATABASE [rtcdyn] TO DISK = N’C:\Backup\rtcdyn.bak’ WITH NOFORMAT, INIT, NAME = N’rtcdyn-Full Database Backup’, SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO
—————END————–
  • Create the 3 .sql scripts and save them to the c:\backup folder.
  • Now create a new .bat file called OCS-sql-backup.bat
———–OCS-sql-backup.bat———–
sqlcmd -S .\rtc -i c:\backup\rtc-backup.sql
sqlcmd -S .\rtc -i c:\backup\rtcconfig-backup.sql
sqlcmd -S .\rtc -i c:\backup\rtcdyn-backup.sql
—————END————–
Now you have 2 .bat files (OCS-sql-backup.bat & OCS-backup.bat) and all that is left is to create a couple of Scheduled Task to run these every day, and configure your file level backup to take backup of the c:\Backup folder.

No comments:

Post a Comment