Microsoft Lync Server 2010 Database Import and Export Tool

The Microsoft Lync Server 2010 database import and export tool, Dbimpexp.exe, is used to import and export homed resources and their data to and from the Lync Server database. This program produces an XML file as output and accepts an XML file as input.


Setting Up and Using Dbimexp.exe

Exporting Data

Importing Data

Additional Options

Required Permissions

Requirements for .NET Framework

Frequently Asked Questions

Copyright

© 2010 Microsoft Corporation. All rights reserved.

Setting Up and Using Dbimexp.exe

Dbimpexp.exe is installed on the server computer under the Common Files for the Lync Server installation folder. The default is: <drive>: \Program Files\Common Files\Microsoft Lync Server 2010\Support.

The import and export tool has two main modes, import and export. The following instructions for exporting and importing a database assume you are running the tool on the server from which you will export the data. Additionally, only the default set of instructions is covered.

When using a localized version of Dbimpexp.exe, the following file is required whenever it is moved from one place to another:

·          %locale%\dbimpexp.resources.dll (The actual folder which this file is contained in will change depending on the locale of the computer.)

Back to Top

Exporting Data

To export a database:

1.  Stop Lync Server for the pool from which the data is to be exported.

2.  Run Dbimpexp.exe from the <drive>: \Program Files\Common Files\Microsoft Lync Server 2010\Support folder, using the following syntax:
On a Standard Edition server:

dbimpexp.exe /hrxmlfile:"c:\<fullFilePath>.xml"

For a Front End pool:

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

3.      To export data for a single user use the following syntax:

On a Standard Edition server:

dbimpexp.exe /hrxmlfile:"c:\<fullFilePath>.xml"

             /restype:user /user:user@contoso.com

For a Front End pool:

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

             /restype:user /user:user@contoso.com

4.      To export data for a single conferencing directory use the following syntax:

    Note:  You can place the XML file anywhere as long as you specify the full path.

On a Standard Edition server:

dbimpexp.exe /hrxmlfile:"c:\<fullFilePath>.xml"

             /restype:confdir /dirid:1001

For a Front End pool:

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

            /restype:confdir /dirid:1001

Back to Top

Importing Data

To import an XML file that has been created using the export steps above, perform the following steps:

1.  After installing Lync Server, wait for the User Replicator to finish copying data. An event is logged upon completion.

2.  Stop Lync Server on the computer to which you want to import data.

3.  On that same computer run Dbimpexp.exe from the support folder where Lync Server is installed, using the following syntax:

On a Standard Edition server:

dbimpexp.exe /import /hrxmlfile:"c:\<fullFilePath>.xml" /restype:all

For a Front End pool:

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

4.  To import data for a single user, use the following syntax

     Important:  Use this command only when a user was deleted in Active Directory, causing Lync Server to delete all of the user's data. When you import users by using this method, the users only get back their contacts, groups, static presence related data. Any conferences that have PSTN conferencing enabled will not be imported for this user and can potentially cause PSTN access to those conferences to fail. You need to notify the user that all conferences enabled for PSTN conferencing should be verified and rescheduled. You can use the dbanalyze.exe tool to determine the user's conferences that have PSTN conferencing issues.

Note:  The user that is imported must log off and then log back on to get the updates.

On a Standard Edition server:

dbimpexp.exe /import /hrxmlfile:"c:\<fullFilePath>.xml"

             /restype:user /user:user@contoso.com

For a Front End pool:

dbimpexp.exe /import /hrxmlfile:"c:\<fullFilePath>.xml" /sqlserver:<sql server host name>

            /restype:user /user:user@contoso.

5.  To import data for a single conference directory, use the following syntax:

     Important:  Use this command only when the server that previously owned this conference directory is no longer available. When you run this command, you reset the PSTN conferencing IDs allocated from this directory to their previous owners as of the time of the export. As a result, running this command could cause PSTN conferencing failures.

On a Standard Edition server

dbimpexp.exe /import /hrxmlfile:"c:\<fullFilePath>.xml"

             /restype:confdir /dirid:1001

For a Front End pool:

dbimpexp.exe /import /hrxmlfile:"c:\<fullFilePath>.xml" /sqlserver:<sql server host name>

             /restype:confdir /dirid:1001

 

Note:  The name of the imported file must match the name of the exported file.

When you restart Lync Server, your users will have the same resource data they previously had.

Back to Top

Additional Options

You may also specify additional options as follows:

dbimpexp.exe         /hrxmlfile:value

                     [/import]

                     [/delete]

                     [/delcontainermembers]

                     [/movedir]

                     [/dbname:value]

                     [/sqlserver:value] Optional for Standard Edition server; Required for Front End pool

                     [/restype:value]

                     [/user:value]

                     [/dirid:vaule]

                     [/errorlogfile:value]

                     [/errorxmlfile:value]

                     [/filteredhrxml:value]

                     [/missingusers:value]

                     [/maxsqlcon:value]

                     [/legacymovetransform:value]

 

The descriptions for the additional command-line options are as follows:

Option

Description

import

Specifies if data is being imported. Default is export.

hrxmlfile

If /import is specified, this is the homed resources XML file to read from. Otherwise, this is the homed resources XML file to generate. If the file already exists, it will be overwritten.

delete

If /import is specified, deletes all data associated with a homed resource before importing information for this user. Default is to update a value if the homed resource already exists and not to delete data that is not being updated.

Note:  Only applies to servers running Live Communications Server 2005 Service Pack 1 (SP1) or earlier versions.

delcontainermembers

If/import is specified, deletes all container member data associated with a homed resource before importing information for this user. Default is to update existing container members and not to delete container members that are not being updated.

movedir

Moves and imports conference directory data. This option should be used when a conference directory is being moved onto the pool, but not when a database is being restored.

dbname

The name of the database to connect to. The argument value is a string (can be enclosed in double quotes if the value contains any spaces). Default is rtc.

sqlserver

The Microsoft SQL Server instance to connect to. The tool attempts to connect by using Windows Authentication. Default is the rtc instance on the local computer.

restype

Specifies the type of resource to import or export. Possible values are:

"user" for homed users

"confdir" for homed conference directories

"all" for all supported resource types.

Default is "all" for export. If /import is specified, this parameter is required.

user

Specifies the user to be imported or exported. Syntax is user@host (without the “SIP:” prefix). When specified, only this user is processed, and the value “user” is implied for the restype parameter. By default, all users are imported or exported.

dirid

Specifies the conference directory ID, an integer value that represents the conference directory to be imported or exported. When specified, only this conference directory is processed, and the value "confdir" is implied for the restype argument.

By default, all conference directories are imported or exported.

errorlogfile

If /import is specified, indicates the file where errors that occur during import will be logged.

By default, a system-generated temporary file is used.

maxsqlcon

Specifies the maximum number of SQL Server connections to use. Default is 3 for Export and 4 for Import.

filteredhrxml

Specifies the output file with references to the users in the /missingusers removed. Must be different from the file specified by /hrxmlfile.

This parameter is required for Filter.

Important:  Use this command-line option only for users who are no longer present in Active Directory.

missingusers

Specifies a file for users who are not found in the database. The file should contain one missing user URI per line. When specified for Import, creates a file for users that cannot be found, to be reviewed and used as an input for the Filter operation.

Default for Import is to use a system generated temporary file. This parameter is required for Filter.

legacymovetransform

Specifies the output file that contains the filtered data with information specific to Lync Server that is removed from the input. Use this command-line option when you import data into a legacy server.

Back to Top

Required Permissions

Role

Dbimpexp /import

Dbimpexp /import /delete

Dbimpexp /export

ReadOnly

 

 

X

AdminRole

X

 

X

dbo / local administrator

X

X

X

Back to Top

Requirements for .NET Framework

The .NET Framework version 1.1 or later is required for this tool. By default, .NET Framework version 1.1 does not allow managed applications to run from network shares. Ensure that Dbimpexp.exe is run locally. If you have to copy the file from a network share, see “Setting Up and Using Dbimpexp.exe” earlier in this document for a list of the necessary files to copy.

Back to Top

Frequently Asked Questions

Q:  Why are other available options not covered in this document?

A:  These options are not required for basic tool functionality.

 

Q:  Why can I not run the tool from one computer against all my home servers?

A:  Because the Microsoft Data Engine (MSDE) allows only local connections, the tool must be run locally from each home server.

 

Q:  When do I use the maxsqlcon option?

A:  This option reduces the number of SQL connections on a slower computer. It can also be used to increase the number of connections if Lync Server is not connected to the database and performing operations, thus increasing the speed of the tool.

 

Q:  I get the error below. What do I need to do?

Error: Failed to import Homed Resource user@contoso.com.

AffectedUser: user@contoso.com

   Details: Cannot import a user that is not already provisioned in the database

Failed to create a homed resource entry

A:  The user specified in the XML file is not provisioned in the database. The import operation requires users to be provisioned in the database. Provisioning failures occur when the User Replicator encounters errors while replicating Active Directory users. Check for any User Replicator event log errors or warnings in the pool used to import the user data. In the case of a Lync Server Front End pool, run Dbanalyze.exe to find out which of the servers in the pool has been assigned the task of running User Replicator.

In the case of a clean installation, wait for the User Replicator event shown below to ensure the initial replication of the Active Directory domains is finished.

User Replicator has completed initial synchronization of domain <domain> (DN: <naming context DN>) and the database. Future synchronization for this domain will occur as changes are made in Active Directory.

Following the initial cycle completion, it will take 60 seconds (default value for User Replicator cycle interval) for changes to the Active Directory Domain Services to be propagated to the database.

Back to Top

Copyright

This document is provided “as-is”. Information and views expressed in this document, including URL and other Internet website references, may change without notice. You bear the risk of using it.

Some examples depicted herein are provided for illustration only and are fictitious.  No real association or connection is intended or should be inferred.

This document does not provide you with any legal rights to any intellectual property in any Microsoft product. You may copy and use this document for your internal, reference purposes.

Copyright © 2010 Microsoft Corporation. All rights reserved.

Microsoft, Active Directory, Lync, SQL Server, Windows, and Windows Server are trademarks of the Microsoft group of companies. All other trademarks are property of their respective owners.

Back to Top