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:
An example would be:
To import data from your backed up .xml file, the following command would import user data:
An example would be:
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:
To import that specific user’s data from their backed up .xml file, the following command would import that user’s data.
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:
To export only the conference data, the following restype would be specified
When using /restype:confdir, you can also specific a specific conference directory by using the /dirid switch as follows:
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:
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:
To filter for a specific Conference Directory, we would run the following command:
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:
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:
After all Lync Server 2013 Preview services have been stopped, the following command will start all the Lync Server 2013 Preview services.
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:
To filter for a specific Conference Directory, we would run the following command:
Lior Efraim says
did i can import user data to all other users data, for populating Lync contact list?
Andrew says
Octavio Hope it isn't too late, try the ExppHomedResourceXml SP in the RTC database
Octavio says
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.
shenoy says
Hi.. Thanks for the nice post. Just have this question, what does "SQL blob store" refers to?
Elan Shudnow says
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.
shenoy says
Thanks. Do you have a blog on Lync 2013 DB Architecture, BE DBs and FE DBs,? I could not find any good reference.
Elan Shudnow says
This is probably the closest that exists: http://terenceluk.blogspot.com/2012/12/microsoft-…
joki says
Hi how i backup in lync 2010 Response Group and the Conferencing Attendant configuration
rafavekia says
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…
Turbomcp says
Thanks alot
valuable info for my next month lync 2013 exams
Hanila says
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/
Hanila says
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/
Anil Singh says
Nice post, I just came to know lync 2013 preview has this new extension :)