RSS Subscription 167 Posts and 2,643 Comments

DBIMPEXP.exe functionality integrated into Lync 2013 Preview Management Shell

Prior to Lync Server 2013, there was a tool.  And this tool was called DBIMPEXP.exe.  It stands for Database Import Export.  This tool was part of the OCS and Lync 2010 Resource Kits, but will now be deprecated to make way for built-in Lync Management Shell PowerShell commands.  But before we talk about its replacement in detail, let’s talk a little bit about DBIMPEXE.exe’s capabilities. DBIMPEXP.exe was used to back up users contact and conference data.  In fact, part of the official backup instructions were to use the DBIMPEXP.exe to backup user data.

Lync Server 2010 – DBIMPEXP.EXE

Note: I am documenting the commands below for Enterprise Edition of Lync.  For Standard Edition, simply remove /sqlserver.

Backing up and restoring all user data

From the official, “Backing Up Core Data and Settings” Technet article, Microsoft provides the following DBIMPEXP.exe commands to back up user data:

Dbimpexp.exe /hrxmlfile:<path and backup file name> /sqlserver:<SQL Server FQDN>\<instance name>

An example would be:

Dbimpexp.exe /hrxmlfile:D:\BackupUser.xml /sqlserver:sql.contoso.com\rtc

To import data from your backed up .xml file, the following command would import user data:

Dbimpexp.exe /hrxmlfile:<path and file name of backed up Rtc database> /sqlserver:<SQL Server FQDN>\<instance name> /import /restype:all

An example would be:

Dbimpexp.exe /hrxmlfile:D\BackupUsers.xml /sqlserver:sql.contoso.com\rtc /import /restype:all

 Backing up and restoring specific user’s data

There is more control over the usage of Dbimpexp.exe.  With the above commands, you are essentially backing up and restoring the entire rtc database for all user contact and conference information.  If we wanted to backup a specific  user’s contact/conference information, we can run the following command:

dbimpexp.exe /hrxmlfile:contacts.xml /user:<sip URL> /sqlserver:sqlservername

To import that specific user’s data from their backed up .xml file, the following command would import that user’s data.

dbimpexp.exe /import /hrxmlfile:contacts.xml /user:<sip URL> /sqlserver:SQL_SERVER

Backing up specific data resource types

With the aforementioned commands, all have a /restype set to all.  This means both contact list and conference directory information is exported.  There is a way to backup either the user or conference data without exporting both.  To export only the user contact list data, the following restype would be specified:

/restype:user

To export only the conference data, the following restype would be specified

/restype:confdir

When using /restype:confdir, you can also specific a specific conference directory by using the /dirid switch as follows:

/dirid:1001

 

 Lync Server 2013 Preview – *-CSUserData

Lync Server 2013 Preview has deprecated the use of DBIMPEXP.exe.  There are now native Lync Mangement Server cmdlets to provide the equivalent.  These three commands are:

  • Export-CSUserData – Exports User Data to a ZIP File
  • Import-CSUserData – Imports User Data from a ZIP File.  This does require a restart of the Front End Service (RTCSRV) to allow the data from the SQL blob store to the RTC Database.  This is a fast process to import data and is geared more towards bulk import operations.
  • Update-CSUserData – Updates User data from a ZIP File  This does NOT require a reboot of the Front End Service (RTCSRV)  but is an expensive and slow process and therefore, should only be run in one-off user scenarios rather than bulk import operations.
  • Convert-CSUserData – Converts between a 2010 XML file provided from DBIMPEXP.exe and a ZIP file provided from Export-CSUserData

Note: For this article, I will be showing the new Export-CSUserData and Import-CSUserData commands.  In a future article for Lync Server 2013 RTM, I will provide more information on the remaining commands.

Export-CSUserData

This is the direct replacement for dbimpexp.exe /export.

The command I will be running against my test Lync Server 2013 Preview Pool is as follows:

Export-CsUserData -PoolFQDN “lync15pool.15lab.net” -FileName “C:\Logs\ExportedUserData.zip”

After exporting the data, we see that we now have a ZIP file.

And within that ZIP, we get a couple XMLfiles.  The meat of the data is stored in DocItemSet.xml.

Just as with DBIMPEXP.exe, we can filter on specific users and conference directories for export.

To filter for a specific user, we would run the following command:

Export-CsUserData -PoolFQDN “Pool FQDN” -UserFilter “user@domain.com” -FileName “<path and backup file name>”

To filter for a specific Conference Directory, we would run the following command:

Export-CsUserData -PoolFQDN “Pool FQDN” -ConfDirectoryFilter 13 -FileName “<path and backup file name>”

Import-CSUserData

This is the direct replacement for dbimpexp.exe /import.  It imports data from the ZIP file previously exported from Export-CSUserData.  Then the user data will be replicated with Active Directory automatically at regular time via Lync user replicator service

I will be importing the data I ran previously from Export-CSUserData. The command I will be running against my test Lync Server 2013 Preview Pool is as follows:

Import-CsUserData -PoolFQDN “lync15pool.15lab.net” -FileName “C:\Logs\ExportedUserData.zip”

After importing the data, we see need to restart the Front End Service, RTCSRV, on all Front End Servers in the pool so that the restored data will propagate from the SQL blob store.

This can easily be achieved by running the following commands:

Stop-CSWindowsService -Name RTCSRV

After all Lync Server 2013 Preview services have been stopped, the following command will start all the Lync Server 2013 Preview services.

Start-CSWindowsService

Just as with DBIMPEXP.exe, we can filter on specific users and conference directories to import.

To filter for a specific user, we would run the following command:

Import-CsUserData -PoolFQDN “Pool FQDN” -UserFilter “user@domain.com” -FileName “<path and backup file name>”

To filter for a specific Conference Directory, we would run the following command:

Import-CsUserData -PoolFQDN “Pool FQDN” -ConfDirectoryFilter 13 -FileName “<path and backup file name>”
Share

13 Responses to “DBIMPEXP.exe functionality integrated into Lync 2013 Preview Management Shell”

  1. on 14 Oct 2012 at 12:01 amAnil Singh

    Nice post, I just came to know lync 2013 preview has this new extension :)

  2. [...] DBIMPEXP.exe functionality integrated into Lync 2013 Preview Management Shell By Exchange Server MVP Elan Shudnow – [...]

  3. on 22 Oct 2012 at 7:59 pmHanila

    I like the valuable info you provide in your articles. I’ll bookmark your weblog and check again here regularly. I’m quite sure I’ll learn many new stuff right here! Good luck for the next !http://journalpsyche.org/

  4. on 22 Oct 2012 at 8:00 pmHanila

    I like the valuable info you provide in your articles. Ill bookmark your weblog and check again here regularly. Im quite sure Ill learn many new stuff right here! Good luck for the next !http://journalpsyche.org/

  5. on 27 Oct 2012 at 4:49 pmTurbomcp

    Thanks alot
    valuable info for my next month lync 2013 exams

  6. on 07 Mar 2013 at 5:32 amrafavekia

    Hi Elan, very nice post!
    I did write a post about How export contacts in OCS/Lync2010 and import in Lync 2013!
    http://uclavecchia.wordpress.com/2013/03/06/expor

  7. on 03 Apr 2013 at 4:22 pm| augi.ath.cx

    [...] http://www.shudnow.net/2012/10/09/dbimpexp-exe-functionality-integrated-into-lync-2013-preview-manag… [...]

  8. on 10 Apr 2013 at 1:39 pmjoki

    Hi how i backup in lync 2010 Response Group and the Conferencing Attendant configuration

  9. on 28 May 2013 at 1:50 amshenoy

    Hi.. Thanks for the nice post. Just have this question, what does "SQL blob store" refers to?

  10. on 28 May 2013 at 8:56 amElan Shudnow

    It just means that the instance is used for lazy writes from the Front End Server and then used for rehydrating other servers in the pool with user data.

  11. on 28 May 2013 at 9:32 pmshenoy

    Thanks. Do you have a blog on Lync 2013 DB Architecture, BE DBs and FE DBs,? I could not find any good reference.

  12. on 06 Jun 2013 at 9:36 pmElan Shudnow

    This is probably the closest that exists: http://terenceluk.blogspot.com/2012/12/microsoft-

  13. on 08 Jul 2013 at 8:58 pmOctavio

    I want to extract lost contacts for a certain user from a SQL backup (from a date where the contacts existed — about a month ago). I do not want to restore over our current good SQL. I just want to extract these contacts into XML and then use the Lync shell to reimport for the specific user in question. The shell appears that it can only work to import and export from the production SQL DB. Can you help me out? I've looked everywhere for what I thought would be a common task. Not sure if other admins have come across this issue in Lync 2013 yet.

Trackback this post | Feed on Comments to this post

Leave a Reply