We’ve had a few migration-related questions coming in, now that Lync Server 2013 is available.

For the most part it’s questions like, “how do I prep our servers” and “will we need to upgrade SQL Server?” (Hmmm, I should do another post on that.)

But today’s post is a warning. If you want to backup your Lync user data, make sure you use the right tool!

Does the CsUser Cmdlet Export User Data? No

We had a question come in about using the CsUser cmdlet to retrieve user information and contact lists. In other words, would CsUser be all they needed for a backup & restore?

Retrieving user information IS part of CsUser’s functionality…but it won’t help you in a migration scenario.

Why not? Well, let’s explore CsUser a bit and we’ll see.

What does it do? It allows you to access, enable/disable, or move Lync users within Active Directory. These are some of its relevant commands:

You’ll notice I didn’t put down a Backup-CsUser cmdlet.
Because there isn’t one.

If you want to backup Lync users, use DBImpExp

Exporting Lync contacts is the function of DBImpExp.exe. If you haven’t heard of it, it’s a Microsoft utility on the Lync Front End server. Essentially, its purpose is to backup/restore user contact lists and conference ID data.

When used, DBImpExp creates XML files of user data. Handy for backing up or moving to other locations.

To export all contact lists on an Enterprise Edition server, you’d use this format:

dbimpexp.exe /sqlserver:”[SQL Server FQDN Instance]” /hrxmlfile:”[Path where you want to store the XML file]”

To import the same XML file to a new server, the format is:

dbimpexp.exe /import /sqlserver:”[SQL Server FQDN Instance]” /hrxmlfile:”[Same path to the XML file]” /restype:user

Not too complex, right?

Justin Morris has a very easy-to-follow writeup on DBImpExp at his blog: Exporting and Importing Contact Lists in Lync Server 2010

Do NOT miss this step in your Lync migrations! If you do, you’ll have to recreate a lot of user data. And your users won’t be happy with you for losing a bunch of their information!

Cover All Your Backup Bases Before You Migrate

These TechNet articles contain the requirements for Lync Server backup and restoration, as well as which tools to use (including cmdlets):
Backup and Restoration Requirements: Data – TechNet Lync Server 2010
Backup and Restoration Requirements: Tools and Permissions – TechNet Lync Server 2010
As you can see, CsUser is not on this list. But DBImpExp.exe is.

If it’s time to migrate, check that you have everything from these lists BEFORE you move on to the new server!

BLOG NOTE: I might have a short post next week, depending on our holiday schedule. Either way, we won’t have a post the week after that. So I’ll take this time to wish you a Merry Christmas, a Happy New Year, and we hope you enjoy everything about your holiday season.

Use DBImpExp to Export Contacts, Not CsUser: Backing Up User Data the Right Way in Lync Server

3 thoughts on “Use DBImpExp to Export Contacts, Not CsUser: Backing Up User Data the Right Way in Lync Server

  • July 11, 2014 at 5:21 am

    Question for import, I try to import another batch of 900 users contacts into an existing Lync 2010 environment which already has over thousands users. Is that okay to run that dbimpexp without -user switch to import? Will this overwrite the current existing contacts information in the SQL DBs or just append to the DBs? Any help will be greatly appreciated.

    • July 11, 2014 at 7:17 am

      Hello! Thanks for the question. Importing should not overwrite anything – though with that large of an import, I’d suggest doing a SQL backup beforehand just in case an error occurs. According to documentation, it’s advisable to use the “/restype:user” switch when importing. Otherwise Lync might assume you mean “/restype:all”, which will import conferencing directories as well. That might cause a problem.
      Please consult all the links I referenced in this post before you run your import. Pays to be prepared–even if everything imports smoothly (and I hope it does!).

  • July 11, 2014 at 12:06 pm

    Thank you so much for your expertise!


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.