Office Communications Server 2007 R2: Backup and Restore Your OCS 2007 R2 Contacts

Export your OCS 2007 R2 contacts to an XML file with the Dbimpexp utility, and save yourself valuable time and effort.

Anthony de Lagarde

The more you have to lose, the more important it is to have a bulletproof backup strategy. Microsoft Office Communications Server (OCS) 2007 R2 lets you choose from a myriad of message formats—including instant messaging, enhanced presence, Web conferencing, audio/video conferencing, federation with external organizations, and telephony solutions that can support enterprise-level collaboration requirements. With this many message types, a virtually foolproof backup system is essential.

OCS 2007 R2 builds upon Microsoft Office Communications Server 2007 RTM and Live Communications Server 2005. OCS 2007 R2 comes in either a Standard or Enterprise version, which you can deploy within a single Active Directory forest or a resource forest.

You back up OCS 2007 R2 user contacts listed in the Microsoft Office Communicator (MOC) client with a tool called Dbimpexp.exe. This binary file is installed in [drive]:\Program Files\Common Files\Microsoft Office Communications Server 2007 R2\Support when you first install OCS 2007 R2.

Why Use Dbimpexp?

OCS 2007 R2 uses Microsoft SQL Server or Microsoft SQL Server Express to store data—depending on the version. There are several different databases that handle different OCS 2007 R2 functions. User information and subscriptions are stored in the RTC database. Besides nightly system and application backups, it’s a good idea to also export user base contacts as part of the overall backup and restore strategy. Dbimpexp will export user contacts to an XML file for you.

Consider this simple scenario that could occur in any office that has deployed OCS 2007 R2: A user opens a help desk ticket stating he has accidentally deleted all his contacts from his MOC. What’s the proper course of action?

If there are just a few contacts that are part of the internal organization, the IT help desk could assist the user in adding the contacts back manually. But what if the staff member had more than 100 MOC entries—and some external accounts derived through OCS 2007 R2 federation services? How could you address this? Adding contacts manually would be time-consuming and not productive for either the end user or the help desk staff member.

One possible option would be to restore the database during off hours, which would bring back all the items from the previous day for the one user. The downside of this action is that it would negatively impact other staff members who may have added contacts during that same time frame. They would find their most recent MOC entries missing.

The Best Solution

Nightly contact exports using the Dbimpexp.exe utility can help the OCS 2007 R2 administrator restore contacts for one particular user without affecting any other OCS 2007 R2 users in the organization. For this demonstration, we’ll use an OCS 2007 R2 Enterprise environment consisting of the following (as shown in Figure 1):

  • One front-end OCS 2007 R2 Enterprise Edition built on Windows Server 2008
  • One back-end SQL Server 2008 Enterprise Edition hosting the OCS 2007 R2 databases built on Windows Server 2008
  • One Active Directory domain controller hosting DNS and the Certificate Authority built on Windows Server 2008

The Microsoft Communications Server 2007 R2 Enterprise environment

Figure 1 The Microsoft Communications Server 2007 R2 Enterprise environment.

Required Permissions

Figure 2 gives you a view of the rights required to perform the outlined functions with Dbimpexp.exe in relation to the OCS 2007 R2 contacts.

Role Dbimpexp /import Dbimpexp /import /delete Dbimpexp /export
Read-only     X
OCS Admin Role X   X
SQL DBO / Local Administrator X X X

Figure 2 The admin account will need specific rights in order to perform these functions with the Dbimpexep.exe utility.

The demonstration account has the OCS Admin Role. It also has administrative rights to the SQL server. You’ll run the Dbimpexp.exe export and import commands on the front-end OCS 2007R2. The syntax for exporting OCS 2007 R2 contacts with Dbimpexp.exe will vary depending on whether you’re running OCS 2007 R2 Standard Edition or the Enterprise Edition. Dbimpexp.exe is also flexible enough to export and import the entire pool of the user’s contacts, or just a single very important person (VIP).

Exporting Contacts

On the OCS 2007 R2 Standard Edition, the syntax to export the entire user base contacts would be:

dbimpexp.exe /hrxmlfile:"c:\ocsusers.xml"

On the OCS 2007 R2 Enterprise Edition (pool), the syntax to export the entire user base contacts is:

dbimpexp.exe /hrxmlfile:"c:\ocsusers.xml" /sqlserver:<sql server instance name>

In our scenario from an administrative command prompt, it’s therefore:

dbimpexp.exe /hrxmlfile:"C:\Backup\ocsusers.xml" /sqlserver:sqlserv01-gburg.delanet.local

The command will interactively show how many users were processed and if the operation completed successfully. You can script and set the command to run through Task Scheduler.

Importing Contacts

To Import user contacts, the syntax for OCS 2007 R2 Standard Edition is:

dbimpexp.exe /import /hrxmlfile:"c:\ocsusers.xml" /restype:all

For OCS 2007 R2 Enterprise Edition (pool) the command is:

dbimpexp.exe /import /hrxmlfile:"c:\ocsusers.xml" /sqlserver:<sql server instance name> /restype:all

For our scenario, where a single user lost his contacts, the following command will restore the contacts in the MOC: 

dbimpexp.exe /import /hrxmlfile:"c:\Backup\ocsusers.xml"
/sqlserver:sqlserv01-gburg.delanet.local /restype:user 

The syntax “/user:anthony.delagarde@delanet.local” is the SIP address of the user.

OCS 2007 R2 can list specific contacts or all of a user’s contacts

Figure 3 OCS 2007 R2 can list specific contacts or all of a user’s contacts.

Incorporating Dbumpexp.exe as part of the holistic process of backups can result in significant time savings when the need to restore one user’s or multiple users’ contacts is required (see Figure 3). It can also give you considerable flexibility when you need different backup options.

Anthony de Lagarde

Anthony de Lagarde* is a senior infrastructure consultant for the Microsoft Federal Practice with more than 17 years of experience in Information Technology.*